【发布时间】:2025-12-23 13:30:10
【问题描述】:
我在 Laravel 5.1 中使用 Ryan Durham https://github.com/rydurham/Sentinel 的哨兵。
我曾经在 Larvel 4.2 中使用 Confide https://github.com/Zizaco/confide。
有了 Confide,我可以像这样为任何路由添加身份验证
// Applies auth filter to the routes within orders/
Route::when('orders/*', 'auth');
我已经在 Sentinel 文档中搜索了此功能,但我不知道如何完成此操作。我可以在控制器的构造中为 admin 或 user 设置身份验证,但我需要在特定路由上具有特定的身份验证能力。
我的问题是,我如何以与 Confide 相同的干净方式使用 rydurham sentinel 将 user 重定向到仅用于 admin 的路线?
【问题讨论】:
标签: authentication laravel-5.1