我正在使用laravel 5.2。我在routes.php中有以下路线
Route::prefix('manage')->group(function () {
Route::get('/', 'ManageController@index');
Route::get('/dashboard','ManageController@dashboard')->name('manage.dashboard');
});
然后当我尝试php artisan serve命令时,我的cmd出现以下错误
Method prefix does not exit
如何解决这个问题?
答案 0 :(得分:4)
请参阅文档https://laravel.com/docs/5.2/routing#route-groups
Route::group(['prefix' => 'manage'], function () {
Route::get('/', 'ManageController@index');
Route::get('/dashboard','ManageController@dashboard')->name('manage.dashboard');
});