NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
路由中间件 只允许通过认证的用户访问指定的路由。Laravel 默认提供了 auth 中间件,放在 app\Http\Middleware\Authenticate.php。 你需要做的只是将其加到一个路由定义中: ~~~ ~~~ // With A Route Closure... Route::get('profile', ['middleware' => 'auth', function() { // Only authenticated users may enter... }]); // With A Controller... Route::get('profile', ['middleware' => 'auth', 'uses' => 'ProfileController@show']); ~~~ ~~~