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:
@@ -260,7 +260,7 @@ return new class extends Migration
|
||||
};
|
||||
```
|
||||
|
||||
### 5. Permissions (REQUIRED)
|
||||
### 5. Permissions (REQUIRED) - AUTO-LOADED
|
||||
|
||||
**File**: `src/app/Modules/[ModuleName]/Permissions.php`
|
||||
|
||||
@@ -275,6 +275,9 @@ return [
|
||||
];
|
||||
```
|
||||
|
||||
> **✅ AUTO-LOADED**: `RolePermissionSeeder` automatically scans all `app/Modules/*/Permissions.php`
|
||||
> files and registers them. Just run `php artisan db:seed --class=RolePermissionSeeder`.
|
||||
|
||||
### 6. Filament Resource (REQUIRED for admin)
|
||||
|
||||
**File**: `src/app/Modules/[ModuleName]/Filament/Resources/[ModelName]Resource.php`
|
||||
|
||||
Reference in New Issue
Block a user