
Explore the database structure for a Laravel app, define role and permission models with a fillable title, and create pivot tables permission_role and role_user to establish many-to-many relationships.
Define the relationships on the role, permission, and user models with belongsToMany to enable proper seeding and provide accessors to distinguish admin from normal users.
Define and create seeders for roles, permissions, and pivot tables to preconfigure admin and user access in a Laravel app, ensuring role assignment, permission provisioning, and modifiable data for production.
Install Laravel Breeze and build a simple to-do CRUD app, implementing roles and permissions with authorization checks on the index page, using Blade with Alpine and gates.
Register an auth gates middleware that runs on every request to load the current user's roles and permissions, then define gates for each permission for frontend and backend authorization.
Implement backend authorization in Laravel by defining unique permission gates from roles, using Gate checks, aborting on undefined gates, and validating access for admins and other users.
Implement frontend authorization checks in a Laravel app using gates and the can directive to show or hide the to-dos link based on todo_access and todo_create, and reinforce backend checks.
Implement admin and user middleware in a Laravel app to guard route groups by role, using user model accessors to detect admin or user status.
Fix and refine the role existence check in Laravel app by correcting queries, using a belongs to many relationship with roles, and introducing a hasRole method to verify admin permissions.
Learn to create a custom blade directive named admin in the app service provider, enabling only admin users to view certain content with simple @admin...@endadmin checks.
Define the permission model and migration for a permissions table with a name column, and build the permission resource with a searchable, sortable form for future role relations.
define a hasPermission method on the user model to check a given permission by aggregating permissions from all user roles, deduplicating, and returning whether the permission exists.
Define a permission policy and implement authorization checks in Laravel and Filament, mapping view any, view, create, edit, and delete permissions to the authenticated user.
Define Laravel policies for categories, roles, tickets, and users, implementing permissions (view, create, edit, delete) and automatic discovery via Filament. Demonstrate admin versus agent access and planned fixes.
Implement fine-grained authorization checks by enabling or disabling UI elements like category toggles and action buttons based on user permissions, such as category_edit and category_access, using Filament's built-in checks.
Refine agent role permissions to restrict creating, editing, and deleting tickets; allow category and ticket viewing with show and index access, implemented at the database level via the serial class.
Implement roles and permissions in an Inertia-based application with Laravel Inertia v3 and Tailwind CSS. Add, assign, and edit roles and permissions while enforcing backend and frontend checks.
Explore the database structure for roles and permissions, including users, roles, and permissions tables and their pivot tables for many-to-many relationships, plus migrations, factories, and seeders.
Define and relate roles and permissions in Laravel by creating models, migrations, pivot tables, and seeders, then seed admin and user roles with corresponding permissions.
Learn to display and delete roles data by using resourceful routes, a role controller, and an inertia-based view that renders roles (id and title) and supports deletion.
Explore the create and update flows for roles in an inertia-based Laravel app, including controllers, validation, and route model binding, with practical crud operations.
Eager load permissions and render a multi-select dropdown to edit a role's permissions. Sync updates, validate selected permissions, and reflect already assigned ones via the role resource.
Define auth gates from the authenticated user's roles and permissions in a Laravel middleware, loop through roles, map each permission to a gate, and enforce access on requests.
implement backend authorization checks with gates and the gate facade in Laravel 11, handling unauthenticated users, and enforce student CRUD permissions (index, create, edit, update, delete) while front end checks.
Implement frontend authorization checks by sharing backend permissions via the Inertia request middleware, allowing the frontend to hide or show actions based on user roles and permissions.
In this course, we will learn to implement Roles and Permissions in Laravel without using any third-party packages.
The knowledge that you gain here can be applied to any Laravel Project, this approach makes the implementation flexible, and new features can be easily added since we don't depend on any external packages.
While implementing the Roles/Permissions functionality, we will learn about the following topics:
Learn how to Define Reusable Custom Blade directives
Learn how to Implement Roles/Permissions in a Filament based application (both frontend and backend)
Learn how to Implement Roles/Permissions in an Inertia-based application.
Also, learn how to use the middleware of Inertia to pass Permission-related data and implement checks accordingly on the front end.
Create CRUD for TODOs and implement checks accordingly (on both frontend and backend)
Define Gates using Laravel Middleware for all the available permissions.
Create Laravel Policies and use Permissions to authorize users.
Define Seeders for Users/Roles/Permissions to ensure that our App works without any issues when deploying it.
Finally, Learn how to implement a flexible solution which makes it easier to scale the system later depending on the needs.
Along with the above concepts, we will also:
Learn about the essential VS Code extensions every PHP/Laravel developer must use.
Learn a few tips/tricks along the way
And many more