Episode 9: Middleware Roles
- Create a migration file for staff role and default staff account.
- Code the new migration file.
- Create new middleware for roles
- Edit the middleware file /app/Http/Middleware/RoleMiddleware.php.
- Add the new middleware to the /app/Http/Kernel.php.
- Apply it in a controller.
- You can redirect to a custom view if you wish.
- You can have specific methods apply middleware.
Leave a Reply