我有一个控制器ManageController
:
public function index()
{
return redirect()->route('manage.dashboard');
}
public function dashboard()
{
return view('admin.manage.dashboard');
}
和路线:
Auth::routes();
Route::prefix('manage')->middleware('role:superadministrator|administrator|editor')
->group(function () {
Route::get('/', 'ManageController@index');
Route::get('/dashboard', 'ManageController@dashboard')->name('manage.dashboard');
Route::resource('/users', 'UserController');
Route::resource('/permissions', 'PermissionController', ['except' => 'destroy']);
Route::resource('/roles', 'RoleController', ['except' => 'destroy']);
});
并在LoginController
中修改了一行:
protected $redirectTo = '/manage/dashboard';
我遇到的麻烦是我收到错误
Symfony \ Component \ HttpKernel \ Exception \ HttpException
No message
laravel.log
中没有消息的应用程序后。并且网址为http://localhost:8000/manage/dashboard
答案 0 :(得分:0)
应该是
protected $redirectTo = '/dashboard';
您没有路线/manage/dashboard