我已经创建了身份验证,并且它运行良好。但检查内页时存在一些问题。例如,
Route::get('/', array('before' => 'auth' , 'do'=> function(){
return View::make('home.index');
}));
索引页面仅对登录用户可见。但每当我进入内页时,例如example.com/products
。无需登录即可查看产品页面。
这是我的解决方案。
/**
* Groups of routes that needs authentication to access.
*/
Route::group(array('before' => 'auth'), function()
{
Route::get('user/logout', array(
'uses' => 'UserController@doLogout',
));
Route::get('/', function() {
return Redirect::to('dashboard');
});
Route::get('dashboard', array(
'uses' => 'DashboardController@showIndex',
));
// More Routes
});
// Here Routes that don't need Auth.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)