| title | User Module Documentation | ||
|---|---|---|---|
| type | documentation | ||
| tags |
|
||
| created | 2026-06-05 | ||
| updated | 2026-07-27 |
Il modulo User gestisce l'autenticazione, l'autorizzazione e la gestione utenti completa nel sistema [PROJECT_NAME] platform.
- Login multi-tenant
- Gestione sessioni sicure
- Two-factor authentication (opzionale)
- RBAC (Role-Based Access Control) via Spatie Permission
- Teams e Tenant isolation
- Policy Filament integrate
// User base model
Modules\User\Models\User extends BaseModel
// Team management
Modules\User\Models\Team
// Tenant isolation
Modules\User\Models\Tenant| Trait | Scopo | Requisiti |
|---|---|---|
HasTeams |
Gestione team multipli | HasRoles |
HasTenants |
Multi-tenancy Filament | HasRoles |
HasAuthenticationLogTrait |
Logging autenticazioni | - |
In compliance with the Global Rule, all root-level capitalized directories (Actions/, Application/, Database/, Events/, Listeners/) have been moved into app/ or renamed to lowercase database/.
- app/: Home for all PHP functional code (mapped via PSR-4).
- database/: Strictly lowercase for migrations/factories/seeders.
Per evitare crash dei parallel workers su analisi massive, usare sempre:
php -d memory_limit=-1 ./vendor/bin/phpstan analyse [target] --memory-limit=-1
Owner schema = WorkOrder (main_module), non User:
- profile-schema-ownership.md
- wiki/concepts/profile-migration-uuid-contract.md
- Migrazione canonica:
WorkOrder/database/migrations/2026_07_27_111500_create_profiles_table.php - Duplicati User archiviati in
database/migrations/_bak/*.merged
laravel/config/permission.php→ nomi pivot singolari (model_has_role, …)- Vietato modificare
table_nameso hardcodare nomi tabella in migrazioni/modelli - wiki/concepts/spatie-permission-table-names.md
- wiki/concepts/spatie-permission-migration-no-table-name.md
Log::info(), Log::debug(), Log::error() are forbidden in Actions, Models, Services, and Widgets.
Found and removed from RegisterWidget. Laravel logs unhandled exceptions automatically.
See: no-log-in-production.md
46 migration files in database/migrations/ had unresolved conflict markers .
These break PHP syntax and halt PHPStan entirely. All were resolved.
Rule: never commit files with conflict markers. Fix immediately when found.
- PHP 8.3+
- Laravel 11/12
- Spatie Laravel Permission
- Filament v5
- On-Demand Pattern — Pattern per caricamento efficiente
- QMD Setup — Configurazione ricerca locale
- Performance — Metriche e best practice
- Project Structure — Directory layout