ui/.ai/skills/laravel-laravel-prompting-patterns/SKILL.md
Use Laravel-specific vocabulary—Eloquent patterns, Form Requests, API resources, jobs/queues—to get idiomatic framework code
npx skillsauth add noartem/kawa laravel-laravel-prompting-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use Laravel's vocabulary to get idiomatic code. Generic requests produce generic solutions that don't leverage the framework.
"Get all active users with their posts"
"Query active users with eager-loaded posts using Eloquent:
User::where('active', true)
->with('posts')
->get();
Add a scope to User model: scopeActive($query)"
"Set up a many-to-many relationship between Posts and Tags:
post_tag pivot table migrationbelongsToMany in Post modelbelongsToMany in Tag modelattach(), detach(), sync() for management""Avoid N+1 on the posts index:
author and category relationshipswithCount('comments') for comment totalspublished_at and category_id""Validate the user input"
"Create UserStoreRequest with validation rules:
public function rules(): array
{
return [
'email' => ['required', 'email', 'unique:users,email'],
'password' => ['required', 'min:12', Password::defaults()],
'name' => ['required', 'string', 'max:255'],
];
}
Add custom error messages in messages() method"
"Validate order creation:
Rule::exists('products', 'id') for product IDsitems.*.quantity must be integer, min 1Rule::requiredIf() for conditional shipping addressnew HasSufficientStock""Create an API for products"
"Create RESTful product API:
ProductController with apiResource routesProductResource for response transformationProductCollection for index endpoint with paginationauth:sanctumProductStoreRequest and ProductUpdateRequest for validation""Paginate products API:
Product::paginate(20) in controllerProductResource::collection($products)total, per_page, current_page, last_page?page=2 query parameter""Add filtering to products API:
?category=electronics&min_price=100 query paramswhen() for conditional queriesProductFilters class for reusability"Send email after user registers"
"Dispatch SendWelcomeEmail job after registration:
SendWelcomeEmail::dispatch($user)
->onQueue('emails')
->delay(now()->addMinutes(5));
ShouldQueue interface$tries = 3 and $timeout = 30failed() method$tags = ['user:'.$user->id]""Configure queue for payment processing:
redis connection for payments queuequeue:work --queue=payments,defaultretry_after to 90 seconds in config"Process order with job chain:
Bus::chain([
new ValidateInventory($order),
new ChargePayment($order),
new SendConfirmation($order),
])->dispatch();
If any job fails, chain stops. Handle in catch() callback."
"Implement according to Laravel's Eloquent Relationships docs"
"Follow Laravel's Form Request Validation pattern"
"Use Laravel's API Resource pattern for response transformation"
"Configure queues per Laravel Queue docs"
Models & Eloquent:
hasMany, belongsTo, belongsToMany, morphManyscopeActive, scopePublishedget{Attribute}Attribute, set{Attribute}Attributeprotected $casts = ['published_at' => 'datetime']Validation:
UserStoreRequest, ProductUpdateRequestrequired, unique:table,column, exists:table,columnnew Uppercase, Rule::in(['admin', 'user'])API:
UserResource, ProductCollectionpaginate(), simplePaginate(), cursorPaginate()throttle:60,1 middlewareJobs & Queues:
ShouldQueue, dispatch(), dispatchSync()Bus::chain(), Bus::batch()Use Laravel's vocabulary. Get Laravel solutions.
development
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
tools
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.