# Coding conventions

## PHP

- PHP `^8.3`, Laravel `^13`
- Product logic in `laravel/app/Domains/{Feature}/`
- Prefer Actions for use-cases; keep controllers thin
- PHPDoc on every method — see agent rule `php-docblocks`

## Domains

- One concern per domain
- No cross-domain coupling (platform `User` / `Team` only)
- Domain-owned migrations should be clearly attributable to that feature (document tables on the feature wiki page)

## Database

- Target third normal form (3NF); see [Database](database.md)
- Prefer foreign keys and related tables over duplicated columns
- Document any intentional denormalisation on the feature wiki page with rationale

## Front end

- Vue SFCs for Inertia pages/components
- Do not embed removable product business rules only in the front end

## Style

- Follow existing Jetstream / Laravel patterns in this repo
- Use Pint for PHP formatting when touching PHP files
