skillfed

laravel-specialist

Laravel Specialist guides you through building production-ready Laravel 10+ applications with type-safe Eloquent models, queue workers, API resources, and Livewire components. It enforces modern PHP 8.2+ patterns, eager loading, dependency injection, and >85% test coverage across feature and unit tests. Use it for architecting database schemas, implementing authentication flows, optimizing queries, and validating code against PSR-12 standards.

Laravel Specialist builds and configures Laravel 10+ applications with Eloquent models, APIs, queues, and Livewire components.

AI-generated summary based on this skill's SKILL.md

10,759 984 MIT updated by Jeffallan

Install

Jeffallan/claude-skills/laravel-specialist · repository language: Python

git clone https://github.com/Jeffallan/claude-skills
cp -r claude-skills/skills/laravel-specialist ~/.claude/skills/laravel-specialist
npx skillfed install Jeffallan/claude-skills/laravel-specialist

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I build a Laravel 10 REST API with Eloquent models?

Laravel Specialist guides you through structuring REST APIs using Laravel 10's Eloquent ORM. Start by defining migrations and models with proper relationships, then create API resources to transform model data into JSON responses. Use route model binding, implement pagination, and leverage Eloquent's eager loading (with(), select()) to prevent N+1 queries. Apply API resources for consistent data transformation across endpoints, and use Laravel Sanctum for token-based authentication to secure your API routes.

What's the best way to create Eloquent relationships and avoid N+1 queries?

Laravel Specialist emphasizes eager loading as the core strategy: use with() to load relationships upfront rather than lazy-loading them in loops. Define relationships in your Eloquent models using hasMany(), belongsTo(), belongsToMany(), and other methods. Use select() to limit columns fetched, and leverage lazy eager loading (loadMissing()) when needed. Monitor queries with Laravel Debugbar or query logging. Always profile N+1 issues in development and test with realistic data volumes to catch performance regressions early.

How do I set up Laravel Sanctum authentication?

Laravel Specialist walks through Sanctum's token-based flow: publish Sanctum's config, run migrations to create personal_access_tokens table, then implement login endpoints that issue tokens via createToken(). Protect routes with sanctum middleware in your API routes file. Clients send tokens in Authorization: Bearer headers. Sanctum handles token validation, expiration, and revocation. Use it for mobile apps, SPAs, and third-party integrations. Configure token abilities for fine-grained permissions and set appropriate expiration times in config/sanctum.php.

How should I write comprehensive tests with >85% coverage using Pest?

Laravel Specialist recommends Pest for its expressive syntax and Laravel integration. Structure tests as feature tests (HTTP endpoints, database state) and unit tests (business logic, helpers). Use factories and seeders to set up test data, leverage database transactions to isolate tests, and mock external services. Write assertions for happy paths, edge cases, and error responses. Use Pest's dataset() for parameterized tests. Run coverage reports with --coverage flag, aim for >85% across critical paths, and exclude migrations and config files from coverage calculations.

What's the recommended approach for Laravel queue configuration and job processing?

Laravel Specialist covers queue setup with Laravel Horizon for monitoring. Configure queues in config/queue.php (Redis or database driver), define jobs as classes extending Job, and dispatch them via dispatch() or Job::dispatch(). Use Horizon to visualize workers, monitor failed jobs, and configure retry policies. Implement exponential backoff for retries, handle failures gracefully with failed() methods, and use job batching for coordinated work. Run queue workers in production with supervisord, set appropriate timeout values, and log job execution for debugging.

How do I create reactive interfaces with Livewire components?

Laravel Specialist guides building real-time UIs with Livewire's wire:model binding and event listeners. Define component classes extending Component, declare public properties that auto-sync with views, and use wire:model for two-way data binding. Implement methods triggered by user actions (wire:click, wire:change), leverage computed properties for derived state, and use #[Computed] attributes in PHP 8.2+. Combine with Alpine.js for client-side interactivity, validate input with Livewire's validation rules, and optimize re-renders by scoping updates to specific properties.

SKILL.md

rendered from the published skill — quoted content, verbatim

Laravel Specialist

Senior Laravel specialist with deep expertise in Laravel 10+, Eloquent ORM, and modern PHP 8.2+ development.

Core Workflow

  1. Analyse requirements — Identify models, relationships, APIs, and queue needs
  2. Design architecture — Plan database schema, service

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 6 files
skills/laravel-specialist/SKILL.md
skills/laravel-specialist/references/eloquent.md
skills/laravel-specialist/references/livewire.md
skills/laravel-specialist/references/queues.md
skills/laravel-specialist/references/routing.md
skills/laravel-specialist/references/testing.md

Related skills

Tags

orm-mapping queue-workers api-transformation reactive-ui auth-tokens database-migrations job-processing test-coverage type-safety eager-loading