skills/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/laravel-vue-skills 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.
testing
Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects.
tools
shadcn-vue for Vue/Nuxt with Reka UI components and Tailwind. Use for accessible UI, Auto Form, data tables, charts, dark mode, MCP server setup, or encountering component imports, Reka UI errors.
documentation
Wrap multi-write operations in transactions; use dispatchAfterCommit and idempotency patterns to ensure consistency
tools
Stabilize workflows with Template Method or Strategy; extend by adding new classes instead of editing core logic