我有这三条路线Laravel路线“之前”不工作
Route::get('login', [
'uses' => '[email protected]',
'as' => 'login.show',
'before' => 'guest'
]);
Route::get('dashboard', [
'uses' => '[email protected]',
'as' => 'dashboard.show'
]);
Route::filter('guest', function()
{
if (Auth::check())
return Redirect::route('dashboard.show');
});
当我登录的验证:检查()承认它,但而不是重定向我到localhost:8000 /仪表板它重定向我只为localhost:8000
Am'I做错了什么?
非常感谢您的任何建议。
你什么的'DD(网址::航线(“dashboard.show”))'? –
string(31)“http:// localhost:8000/dashboard” 但我不确定是否将dd(URL ...放在正确的位置,我应该在哪里放置它? –
将它放在你的' guest'过滤器 –