我需要移动用户未登录到能够登录的网站。
到目前为止,我尝试过以下方法:
Entrust::routeNeedsRole('admin/advanced*', 'owner', Redirect::to('/home'));
其他但这些方法不起作用,我得到这样的错误:
Method filter does not exist.
我的routes.php文件如下:
Route::group(['middleware' => ['permission:admin']], function () {
Route::get('/admin', 'DashboardController@index');
});
这种方法工作正常,但是当我没有登录时,我收到错误:
Whoops, looks like something went wrong.
1/1
HttpException in Application.php line 905:
控制器
public function __construct()
{
$this->middleware('auth');
}