php artisan boost:add-skill redberry/mailbox-for-laravel
Save this content to: .cursor/rules/backend.md
# Backend Rules
- All files must have `declare(strict_types=1)` at the top
- Use readonly properties where the value is set once in the constructor
- Services must depend on the `MessageStore` contract, never on `DatabaseMessageStore` or `FileStorage` directly
- Controllers are invokable (`__invoke`) for single-action, or use standard resource methods
- Constructor injection only — no `app()` or `resolve()` calls inside methods
- `CaptureService` is the single entry point for all storage operations — don't bypass it
- `MailboxServiceProvider` is the ONLY place that reads `config()` and creates bindings
- Transport depends on `CaptureService` + `AttachmentStore`, not on `MessageStore` directly
- DTOs are plain PHP classes using constructor property promotion (no Spatie Laravel Data); `fromArray()` factories rehydrate stored payloads
- Models use configurable connection via `config('mailbox.store.database.connection')`
- Return types and parameter types are mandatory on all public methods
- Throw domain exceptions for invalid states — no silent failures
- No `env()` calls — use `config()` (env is only read in `config/mailbox.php`)
declare(strict_types=1) at the topMessageStore contract, never on DatabaseMessageStore or FileStorage directly__invoke) for single-action, or use standard resource methodsapp() or resolve() calls inside methodsCaptureService is the single entry point for all storage operations — don't bypass itMailboxServiceProvider is the ONLY place that reads config() and creates bindingsCaptureService + AttachmentStore, not on MessageStore directlyfromArray() factories rehydrate stored payloadsconfig('mailbox.store.database.connection')env() calls — use config() (env is only read in config/mailbox.php)How can I help you explore Laravel packages today?