How amethdiamanka/crud-role-permission-spatie works
Diamanka is a Laravel package for managing Spatie roles and permissions through authenticated web pages. The user workflow is routed requests to role or permission controllers, which validate and mutate Spatie models, then return listing or form views. The README documents creation and listing for both domain types; the sampled controllers also implement edit, update, and deletion. The graph reflects routes, controller behavior, and provider wiring shown in excerpts; database persistence is delegated to Spatie and Laravel, and its internal implementation is not sampled.
Main entry points: RoleController.php Role operations · PermissionController.php Permission operations · web.php Web routes · Controller.php Controller base
Components 12
Routing and setup
- Web routes
routes/web.php - Service provider
src/Providers/DiamankaServiceProvider.php - Controller base
src/Http/Controllers/Controller.php - Spatie role and permission models
Permission management
- Permission operations
src/Http/Controllers/PermissionController.php - Permission storage
Role management
- Role operations
src/Http/Controllers/RoleController.php - Role storage
- Permission cache
Management views
- Permission forms and list
resources/views/permissions - Role forms and list
resources/views/roles
Other components
- Authenticated user
Connections 13
- Authenticated user → Web routes: requests
README.md - Service provider → Web routes: loads
src/Providers/DiamankaServiceProvider.php - Web routes → Permission operations: dispatches
routes/web.php - Web routes → Role operations: dispatches
routes/web.php - Permission operations → Controller base: extends
src/Http/Controllers/PermissionController.php - Role operations → Controller base: extends
src/Http/Controllers/RoleController.php - Permission operations → Permission forms and list: renders
src/Http/Controllers/PermissionController.php - Role operations → Role forms and list: renders
src/Http/Controllers/RoleController.php - Permission operations → Spatie role and permission models: queries and mutates
src/Http/Controllers/PermissionController.php - Role operations → Spatie role and permission models: queries and mutates
src/Http/Controllers/RoleController.php - Spatie role and permission models → Permission storage: persists permissions
- Spatie role and permission models → Role storage: persists roles
- Role operations → Permission cache: clears cache
src/Http/Controllers/RoleController.php