在 web.php 路由文件中,我已经定义了路由组中的所有路由,但其中一些不起作用并显示空白页面,但在没有前缀的路由组之外定义时显示页面。
Route::group(['middleware' => 'auth', 'prefix' => 'admin'], function () {
Route::get('/home', 'HomeController@index')->name('home');
Route::resource('/category', 'CategoryController')->except(['destroy']);
Route::get('/category/delete/{category}', 'CategoryController@destroy')->name('category.delete');
Route::resource('/post', 'PostController')->except(['destroy']);
Route::get('/post/delete/{post}', 'PostController@destroy')->name('post.delete');
Route::get('/post/{post}/restore', 'PostController@restore')->name('post.restore');
Route::get('/post/{post}/forceDelete', 'PostController@forceDelete')->name('post.forceDelete');
Route::resource('/tag', 'TagController')->except(['destroy']);
Route::get('/tag/{tag}/delete', 'TagController@destroy')->name('tag.destroy');
Route::resource('user', 'UserController')->except(['destroy']);
Route::get('/user/{user}/delete', 'UserController@destroy')->name('user.delete');
Route::get('user/{user}/admin', 'UserController@makeAdmin')->name('user.admin')->middleware('admin');
Route::get('/user/{user}/makeUser', 'UserController@makeUser')->name('user.user');
Route::get('user/profile', 'ProfileController@index')->name('user.profile');
Route::post('user/profile/update', 'ProfileController@update')->name('user.profile.update');
});