Laravel Pro Tips
How to implement multi-login redirections in @laravelphp, you can use middleware to check the user's role and redirect them to the appropriate page
If your user only has a role of admin or user, you can create a column of 'is_admin' (boolean type) in the users table and create a custom middleware to check if user is admin or not.
Laravel Tip 💡 Did you know you can enrich request data using a middleware? For example, resolve the user origin country using their IP and add the country abbreviation to the request.
You can exclude middleware at the route level in Laravel using the withoutMiddleware method.
Jan 12th, 2023
Laravel Middleware: Put in Routes, Controller, or Elsewhere? (4 Options)
If you have a Middleware, where you should use it: in the Routes file or in the Controller? Here are the FOUR options.