Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 1.22 KB

README.md

File metadata and controls

29 lines (28 loc) · 1.22 KB

Laravel Roles and Permissions

Simple Role Based Authentication For Laravel Projects

Created Laravel Project Configure DB. Installed Laravel Breeze for Authentication Scaffolding. Removed is_admin in users migrations Created Roles and Permissions Tables Created DB seeds for Admin, Created Relationship between user and roles model with permissions Set default user role to 1 in UserController Setup Admin Layout Dashboard Setup AdminMiddleware with isAdmin() function in users model Made common HasRoleMiddleware and hasRole() for all roles and removed AdminMiddleware and isAdmin() Created Roles and Permissions Route For CRUD Operation Displaying Roles & Permissions in Admin Dashboard Create Page For Roles and Permissions Store New Roles and Permissions Update Roles and Permissions Delete Roles and Permissions Assign Permissions to the Role Created Users index page showing users and their roles Update and asign role to the user Delete Users Created fake posts using factory Displaying all the posts Added policies for posts creation by roles only Authorize user for creating new posts Authorize the admin for all actions Authorization for update and delete Custom Admin blade directive