Laravel Role Lite
Lightweight role & permission management for Laravel
What is Laravel Role Lite?
Laravel Role Lite is a minimal, focused package that brings role-based access control (RBAC) and optional permission management to your Laravel application — without the overhead of heavier solutions.
- Role management — assign, remove, and check roles on any Eloquent model using backed PHP enums or plain strings
- Permission management (opt-in) — database-driven permissions tied to roles, with a two-tier cache for high performance
- Policy integration —
ChecksPermissionstrait wires your Laravel Policies directly to the permission system - Event-driven — role and permission changes dispatch Laravel events you can listen to
composer require oltrematica/laravel-role-lite
Quick Start
// Assign a role and check it
$user->assignRole(UserRole::Admin);
$user->hasRole(UserRole::Admin); // true
// Grant a permission and check it
$user->givePermissionTo('post.create');
$user->hasPermissionTo('post.create'); // true
// Check via canDo helper
$user->canDo(Post::class, 'create'); // true
Documentation
| Page | Description |
|---|---|
| Roles | Installing, configuring, and working with roles |
| Permissions | Opt-in permission system — model permissions, cache, events |
| Policy Integration | Using ChecksPermissions in Laravel Policies |
| Configuration Reference | All config keys explained |
Requirements
- PHP 8.3+
- Laravel 10, 11, 12, or 13
License
MIT — Oltrematica