Den*_*ito 0 authentication routes laravel
我需要禁用 Laravel 中除“/”和“登录”页面之外的所有访客路由。
这有可能实现它 routes/web.php 吗?
是的。在您的routes/web.php文件中,确保在auth中间件组下定义受保护的路由。
路线/ web.php
Route::get('/', function() {
// / route
});
Route::get('/login', function() {
// login page
});
Route::middleware(['auth'])->group(function () {
// define your routes here
// they'll be protected
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
528 次 |
| 最近记录: |