Copy-paste Claude Code prompts for Laravel 11 — Eloquent models, FormRequests, queued jobs, Pest tests, and Filament admin. Matches Laravel conventions out of the box.
Laravel's conventions are well-represented in Claude's training, but production Laravel apps have opinions: FormRequests vs validate(), Service classes, Filament resources, Octane workers. Tell Claude which patterns you use and the output drops in cleanly.
Add a 'Tickets' resource.
Schema:
- id (uuid, primary)
- user_id (foreign key, indexed)
- subject (string, 255, not null)
- body (text, not null)
- status (string, default 'open', indexed)
- priority (string, default 'normal')
- assigned_to (foreign key, nullable)
- timestamps + soft deletes
Constraints:
- Read app/Models/Order.php first as the template.
- Eloquent model with relationships: user(), assignee(), comments() — match Order's style.
- Migration uses Schema::create with the modern fluent syntax.
- FormRequests: StoreTicketRequest, UpdateTicketRequest — auth via gate, rules in array.
- Controller: TicketController extends Controller, uses route-model binding,
authorize('view', $ticket) on show/update/destroy.
- Policy: TicketPolicy with view/update/delete returning Response::allow()/deny().
- Routes: Route::apiResource added to routes/api.php with auth:sanctum middleware.
- Factory + 1 happy-path Pest test for store/index.
- Do NOT run php artisan migrate.
Write a queued job ProcessTicketAttachmentJob that:
- Implements ShouldQueue, on the 'media' connection, queue 'attachments'
- Has $tries = 5 with backoff() returning [10, 60, 300, 900, 3600]
- Has $timeout = 120 and uniqueId() returning the attachment id (ShouldBeUnique)
- Uses Storage::disk('s3') to download, runs Image::make on it, uploads thumbnails
- On final failure: dispatches a TicketAttachmentFailed event and writes to
the audit log (App\Services\AuditLogger)
Constraints:
- Use constructor property promotion (PHP 8.2 syntax).
- Type hints on everything.
- Spec via Pest with Queue::fake() and Storage::fake('s3') — assert the
thumbnail variant was uploaded.
Add a Filament v3 Resource for the existing Order model.
Constraints:
- Read app/Filament/Resources/CustomerResource.php first — match its column
widths, filters, and table actions.
- Form: TextInput for order_number (disabled, displayed), Select for status
(enum-backed), MoneyInput for total_cents.
- Table: order_number, customer.name (Tables\Columns\TextColumn with searchable),
status (badge with colour per enum), total (money), created_at (since).
- Filter: status filter, date range filter on created_at.
- Actions: ViewAction, EditAction. No DeleteAction (we soft-delete from a job).
- Relation manager for OrderItems showing item_name, quantity, line_total.
- Place at app/Filament/Resources/OrderResource.php with the Pages subdirectory.
## Stack
Laravel 11, PHP 8.3, Octane (Swoole), Filament 3, Pest 2 for tests, Sanctum for auth.
## Conventions
- FormRequests for all writes; never validate() in the controller.
- Policies for authorisation; always authorize() in controllers.
- No business logic in models. Use Services in app/Services.
- Money stored as integer cents; never float.
- Filament resources are the admin UI; don't build custom Blade admin pages.
Related: Claude API from PHP, testing prompts.