filament-architecturelisted
Install: claude install-skill zahansafallwa1511/filament-architecture
# Filament + UseCases
Filament is a delivery mechanism, exactly like a controller. Its job is to render, collect input, call **one use case**, and show the result. The business rules — what is allowed, what changes, what happens next — live in **Application use cases** and the **Domain**, which know nothing about Laravel, Filament, HTTP or the database. That lets the rules be unit-tested in milliseconds and reused unchanged from an API endpoint, an artisan command or a queued job.
A quick test for "is this business logic?": *if the same operation were triggered from an API endpoint or a CLI command, would this code have to be copied there?* If yes, it belongs in a use case, not in Filament.
## Layers (layered layout)
| Layer | Path | Contains | May depend on |
|---|---|---|---|
| Domain | `app/Domain/<Context>/` | enums with rules, value objects, domain exceptions, repository/gateway **interfaces**; entities in strict mode | PHP only |
| Application | `app/Application/<Context>/UseCases/` | one class per user intention + its Input/Result DTOs | Domain (+ models in pragmatic mode) |
| Infrastructure | `app/Infrastructure/<Context>/` | Eloquent repositories, mailers, HTTP clients, clock, transactions — implementations of Domain interfaces | anything |
| Filament | `app/Filament/` | resources, pages, actions, schemas, tables | Application, Domain, Models |
| Models | `app/Models/` | Eloquent models (persistence + read model) | Laravel |
**Reads vs writes.** Filament tables,