Build Role Based Access Control (RBAC) System in Laravel 12 & Livewire (Spatie Permission Package)

Опубликовано: 02 Май 2026
на канале: code with SJM
3,639
84

In this video, we build a complete Laravel 12 + Livewire starter kit including role-based access control (RBAC) with Spatie’s permission package. I’ll show step-by-step:

👉 Add Middleware and apply it in your routes for route level access control
Link to middlware: https://github.com/shadrackjm/role-pe...
Link to route file: https://github.com/shadrackjm/role-pe...

Setting up the Laravel 12 project
Installing and configuring spatie/laravel-permission (v6)
Creating database tables & seeders for roles and permissions
Assigning initial roles and permissions to a super-admin
Building UI pages to manage roles and permissions via Livewire components
Setting up a dashboard with role-specific views and statistics
Protecting routes, views, and actions based on roles/permissions

By the end, you’ll have a reusable starter that lets you manage roles and permissions from a UI with Livewire.

Timestamps:
0:00 Introduction & demo
14:43 Application setup
18:20 Laravel Spatie Permission Package integration & Database setup
25:34 Creating User Management Livewire Component
51:34 Creating dummy user
56:40 Creating initial roles & permissions for super admin
1:11:06 Creating Roles & Permission management component
1:40:37 Additional features and dashboard setup

Links & resources
Spatie Permission Package: https://spatie.be/docs/laravel-permis...

Don’t forget to like, subscribe, and hit the bell if you want more Laravel + Livewire tutorials!

#laravel12 #coding #laravel