laravel

Develops Laravel PHP applications with Eloquent, queues, Blade and Livewire.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill laravel-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/laravel
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill laravel-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Laravel applications fail in predictable ways that generic PHP knowledge misses: N+1 queries hidden in Blade loops, queue jobs duplicated by a misconfigured retry_after, dispatches racing ahead of uncommitted transactions, and Pennant flags silently reading as off in jobs. This Skill encodes the framework-specific rules, version differences, and silent-failure modes needed to build, review, debug, and upgrade Laravel 12/13 applications correctly. ## Core Features & Use Cases - Eloquent and data access rules: eager loading strategy, chaperone() for inverse N+1s, preventLazyLoading, mass-assignment discipline, migration staging, and index design. - Queue, event, and scheduling correctness: retry_after versus timeout, idempotency versus ShouldBeUnique, afterCommit dispatching, failed() instance semantics, and scheduler lock behavior. - HTTP, validation, and authorization: form requests, policies and gates, PreventRequestForgery in Laravel 13, rate limiting, and outbound HTTP timeout discipline. - Testing with Pest: deterministic fakes, freezeTime/travelTo, assertion strength, and suite-speed tuning. - Use Case: A controller issues hundreds of queries per request and a warehouse sync job duplicates shipments after deploy. The Skill pinpoints the N+1 and mass-assignment holes in the controller, the retry_after/timeout race in the queue config, and the transaction-dispatch hazard, with exact fixes. ## Quick Start Ask the agent to review your Laravel controller, model, and queue job for N+1 queries, mass-assignment risks, and queue misconfiguration, and propose concrete fixes.

Frequently Asked Questions about laravel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 queries in a Laravel application?

Eager load relationships with Post::with('author') and use withCount() instead of hydrating rows to count them. Enable Model::preventLazyLoading(! app()->isProduction()) in AppServiceProvider::boot() so violations fail loudly in development, and use chaperone() when child models walk back to their parent.

Why does my Laravel queue job run twice after a deploy?

The connection's retry_after is shorter than the job or worker timeout, so a second worker reserves a job still executing. Set retry_after above the longest timeout, keep the worker --timeout below it, and make the job idempotent since a worker can die after the side effect.

What changed in Laravel 13 compared to Laravel 12?

Laravel 13 requires PHP 8.3-8.5, renames the CSRF middleware to PreventRequestForgery, moves queue settings to attributes like #[Tries] and #[Backoff], defaults cache serializable_classes to false, and restores eager-loaded relations on deserialised model collections. The skill's upgrade reference lists the full breaking-change table.

Why does my Pennant feature flag behave differently in jobs and tests?

Pennant stores the resolved value on first check per scope, and the default scope is null in jobs, commands, and unauthenticated routes, which reads as inactive unless the definition accepts null. In tests, re-define the feature with Feature::define('name', true) instead of relying on a Lottery.

Should I use ShouldBeUnique or idempotent processing for Laravel jobs?

Use both: ShouldBeUnique with uniqueId() prevents a second dispatch through a cache lock, while idempotent processing (idempotency keys, uniqueness constraints) prevents a second execution from having a second effect. Uniqueness does not apply inside batches and needs a shared lock-capable store.

When should I not use this Laravel skill?

It does not cover general code review, test-driven-development decisions, frontend design, Inertia's JavaScript side, API contract design, PostgreSQL engine tuning, or hosting platforms like Forge and Vapor. It also excludes non-Laravel PHP such as Symfony and WordPress.