brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
php-laravelModern PHP 8.2+ and Laravel patterns: architecture, Eloquent, queues, Pest testing. Use when asked to "write PHP", "build a Laravel app", "fix Eloquent query", "add a queue job", "write a Pest test", or mentions PHP, Laravel, Eloquent, Blade, artisan, or migrations.
Independent GitHub snapshot · Automated classification · Original documentation governs
declare(strict_types=1) in every fileelse.$exception not $e, $request not $r?string not string|null. Always specify void. Import classnames everywhere, never inline FQN.['required', 'email'] for easier custom rule classesUse these when applicable — do not explain them in comments (Claude and developers know them):
$fn = $obj->method(...)(Stringable&Countable)|null for complex constraints__construct(private readonly PaymentService $payments)Model::preventLazyLoading(!app()->isProduction()) — catch N+1 during developmentPost::with(['user:id,name'])->select(['id', 'title', 'user_id'])Post::where('status', 'draft')->update([...]) — do not load into memory to updateincrement()/decrement() for counters in a single querychunk(1000)), lazy collections for memory-constrained processing$guarded = [] is a mass assignment vulnerability — always use explicit $fillablewhenLoaded() for relationships — prevents N+1 in responseswhen() / mergeWhen() for permission-based field inclusionwhenPivotLoaded() for pivot datawithResponse() for custom headers, with() for metadata (version, pagination)Bus::batch([...])->then()->catch()->finally()->dispatch()Bus::chain([new Step1, new Step2])->dispatch()Redis::throttle('api')->allow(10)->every(60)->then(fn() => ...)ShouldBeUnique interface to prevent duplicate processingfailed() method on jobstest() / it() syntax with RefreshDatabase traitSanctum::actingAs($user, ['ability']) for API auth testingwhereIn() insteadprotected $guarded = [] — use $fillable instead