Laravel + Filament Implementation Guide
This section documents how to implement the Law Firm Management System using Laravel 11 and Filament v3. It is an implementation guide — not a replacement for the system specification. The API contracts, database schema, and RBAC model defined in the architecture documentation remain authoritative. This guide describes how to realise those contracts in Laravel.
Relationship to Existing Documentation
| Existing Doc | Role | This Guide |
|---|---|---|
/database.dbml | Domain model — source of truth | Adapts for Laravel (see Schema Changes) |
/docs/architecture/ | API contracts, C4 diagrams | Implemented by controllers and Filament resources |
/docs/guides/architecture/sequence-diagrams/ | System flows | Same flows, different stack |
Key Implementation Decisions
| Decision | Choice | Rationale |
|---|---|---|
| Auth provider | Laravel built-in | Logto's JWT-bearer model conflicts with Filament's session-based auth |
| Admin UI | Filament v3 | Eliminates a separate frontend for internal staff |
| Application server | Laravel Octane (Swoole) | Amortises Filament's heavy boot cost across requests |
| API auth (mobile) | Laravel Sanctum | Lightweight token auth alongside Filament sessions |
| Multi-tenancy | Filament HasTenants | LAW_FIRMS is the tenant boundary |
Documents in This Guide
Foundation
- README — this file
- Components — every package and why it is needed
- Database Schema Changes — what changes from the original DBML
Architecture
- System Overview — subsystems, request flow, deployment
- Folder Structure — annotated Laravel project tree
- Multi-Tenancy — how
LAW_FIRMSmaps to Filament tenancy
Authentication & Authorization
- Authentication — three Laravel guards, Sanctum for API
- RBAC & Policies —
PERMISSIONS/ROLESschema → Laravel Policies
Filament
- Panels — Admin, Client Portal, Partner Portal panel setup
- Resources — full resource inventory per panel
Domain
- Eloquent Models — all ~96 models, relationships, patterns
- Domain Services — rate resolver, invoice generator, RBAC checker
Infrastructure
- Octane — setup, memory safety, warm-up
- Queues & Jobs — Horizon, job inventory
- Search — Scout + Meilisearch setup
- Real-time — Reverb WebSocket configuration
Testing
- Testing Strategy — tools, conventions, how to run
- API Tests — all User Portal endpoint tests
- Admin API Tests — Admin API endpoint tests
- Filament Tests — panel and resource tests
- Service Unit Tests — domain service tests
- Test Inventory — master checklist of every test