Add auto-loading of module permissions in RolePermissionSeeder
RolePermissionSeeder now automatically scans app/Modules/*/Permissions.php files and registers all permissions found. No manual registration required. - Added loadModulePermissions() method to scan module directories - Changed givePermissionTo() to syncPermissions() for idempotency - Updated Modules README to document auto-loading - Updated CLAUDE.md to reflect auto-loading behavior
This commit is contained in:
@@ -94,6 +94,9 @@ ## Permissions
|
||||
];
|
||||
```
|
||||
|
||||
**Permissions are auto-loaded!** When you run `php artisan db:seed --class=RolePermissionSeeder`,
|
||||
it scans all `app/Modules/*/Permissions.php` files and registers them automatically.
|
||||
|
||||
Use in Blade:
|
||||
```blade
|
||||
@can('stock_management.view')
|
||||
|
||||
Reference in New Issue
Block a user