Hi everybody. I'm building a website with Laravel. There will be different screens for admin and user here. In previous versions, I could define and use auth.php in the routes folder. But I couldn't do this in Laravel 11. I can't define it in bootstrap. Is there any other way?
@dasilva you can do it like create custom middleware and register in Kernel.php under $routeMiddleware array
and inside routes/web.php
Route::group(['middleware' => ['auth', 'role:admin']], function () {
// Your admin routes go here
});
Route::group(['middleware' => ['auth', 'role:user']], function () {
// Your user routes go here
});
@dasilva let me know if you still face any issue on this.