<?php

use App\Http\Middleware\SetUser;
use LaraBB\Admin\Middleware\CheckAdmin;

Route::group([
    'middleware' => [
        SetUser::class
    ],
    'prefix' => 'forum',
], function() {
    Route::get('{slug}', IndexHandler::class)->name('forum');
});

Route::group([
    'namespace' => 'Admin',
    'prefix' => 'admin/forums',
    'middleware' => [
        'auth',
        CheckAdmin::class
    ]
], function() {
    //Route::get('/', OverviewHandler::class)->name('admin-forums');
    Route::get('create', CreateHandler::class)->name('admin.forums.create');
    Route::get('{uuid}', EditHandler::class)->name('admin.forums.edit');
    Route::post('store', StoreHandler::class)->name('admin.forums.store');
    Route::post('update', UpdateHandler::class)->name('admin.forums.update');
    Route::post('destroy', DestroyHandler::class)->name('admin.forums.destroy');
});

