cwsps154/users-roles-permissions
Laravel package to manage users, roles, and permissions with a simple, structured approach. Assign roles to users, define permissions, and check access throughout your app. Lightweight and easy to integrate into existing projects.
Auth::user()), which may require adjustments for custom auth backends (e.g., Sanctum, Passport).filament/resources) and Laravel’s auth contracts, making it modular. Can coexist with existing auth systems if permissions are mapped correctly.roles, permissions, and role_permission pivots. Migration risk: Schema conflicts if the app already has a custom RBAC system.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Filament Version Lock | High | Pin exact Filament version in composer.json. |
| Role/Permission Conflicts | Medium | Audit existing RBAC logic pre-integration. |
| Performance with Large Roles | Medium | Benchmark with expected user/role scale. |
| Custom Auth Backend Support | High | Verify compatibility with Authenticatable contract. |
| Migration Downtime | Medium | Plan zero-downtime schema changes if applicable. |
Filament Dependency:
Existing RBAC:
Scalability:
Gate::before)?Customization Needs:
Audit & Compliance:
Assessment Phase:
Pilot Integration:
Schema Migration:
Logic Replacement:
can:create-posts).API/Non-Filament Integration:
Gate facade for non-Filament contexts (e.g., queues, APIs).| Component | Compatibility Notes |
|---|---|
| Laravel Version | Tested with Laravel 10.x (check composer.json). |
| Filament Version | Must match the package’s requirements (e.g., Filament v3.x). |
| Database | Supports MySQL, PostgreSQL, SQLite (default Laravel DBs). |
| Auth Backend | Assumes Laravel’s default auth (e.g., users table). Custom backends may need adapters. |
| Caching | Leverages Laravel’s cache (e.g., config('cache.default')). |
| Localization | Filament’s built-in localization; package may include translation files. |
Phase 1: Core RBAC Setup
Phase 2: Policy Enforcement
can() checks.Gate::allows() or Filament’s API resources.Phase 3: Edge Cases
Phase 4: Monitoring
try-catch in policies).Gate::before for caching.role_permission) could bloat with many permissions. Mitigation: Denormalize if needed (e.g., JSON column for user permissions).Gate::allows()) scale well.config('cache.default') is a distributed cache (e.g., Redis) in clustered environments.| Failure Scenario | Impact | **
How can I help you explore Laravel packages today?