Laravel Specialist

An AI-powered Laravel development skill for building apps with Eloquent, Sanctum, Horizon queues, Livewire, and Pest tests.

🛠️

Introduction

Laravel Specialist is a specialized AI development skill created by Jeff Allan for the Laravel framework. It provides deep expertise in Laravel 10+, Eloquent ORM, and modern PHP 8.2+ development. The skill is designed for Claude AI and can be installed into any Claude Code or compatible AI coding environment to provide expert-level Laravel development assistance.

With over 18,000 installs, Laravel Specialist is one of the most popular AI development skills, covering Eloquent models and relationships, Sanctum authentication, Horizon queue configuration, RESTful API design with API resources, Livewire components, and comprehensive testing with Pest/PHPUnit. It is available at skills.laravel.cloud/skills/laravel-specialist.

💻

Installation

Install via Artisan Command:

php artisan boost:add-skill jeffallan/claude-skills --skill laravel-specialist

This command installs the Laravel Specialist skill into your Claude Code environment, providing access to reference guides for Eloquent ORM, routing, queues, Livewire, and testing.

🔄

Core Workflow

Laravel Specialist follows a structured 5-step workflow for every development task:

  1. Analyze — Identify models, relationships, APIs, and queue needs based on requirements
  2. Plan — Design database schema, service layers, and job queue architecture
  3. Create — Build Eloquent models with relationships, scopes, and casts; run php artisan migrate and verify with php artisan db:seed
  4. Develop — Implement controllers, services, API resources, and jobs; run php artisan route:list to verify routing
  5. Test — Write feature and unit tests; run php artisan test before considering any step complete (target >85% coverage)
🗄️

Eloquent ORM

The skill provides expert-level guidance on Eloquent ORM patterns:

  • Relationships — Proper use of belongsTo, hasMany, belongsToMany, morphMany, and advanced relationship patterns
  • Eager Loading — Avoid N+1 problems with ::with(), lazy eager loading, and constraint-based loading
  • Query Scopes — Local and global scopes for reusable query logic
  • Accessors & Mutators — Attribute casting, accessors, mutators, and custom casts
  • Query Optimization — Index hints, chunking, cursors, and subquery optimization
  • Soft Deletes — Implementation, querying trashed models, and restoration patterns
🔌

API Development

Laravel Specialist covers the full scope of API development with modern Laravel practices:

  • RESTful APIs — Resource controllers, API resources, pagination, and response formatting
  • Sanctum Authentication — Token-based API auth, SPA authentication, and mobile app auth flows
  • Form Requests — Validation rules, authorization gates, and custom validation logic
  • Middleware — Custom middleware, throttle controls, and API versioning strategies
  • Horizon Queues — Job dispatch, queue configuration, failure handling, and worker supervision

Testing

Comprehensive testing is a core part of the Laravel Specialist workflow, targeting >85% code coverage:

  • Feature Tests — HTTP endpoint testing, authentication flows, and full-stack feature verification
  • Unit Tests — Service layer testing, job testing, and isolated component verification
  • Eloquent Testing — Factory definitions, model relationship assertions, and database state verification
  • Pest PHP — Pest-specific testing patterns including higher-order tests, datasets, and custom helpers
  • Mocking — Proper use of mocks, fakes, and HTTP test doubles

Best Practices

The skill enforces strict coding standards and best practices for Laravel development:

Must DoMust Not Do
Use PHP 8.2+ features (readonly, enums, typed properties)Use raw queries without protection (SQL injection risk)
Type hint all method parameters and return typesSkip eager loading (causes N+1 problems)
Implement API resources for data transformationMix business logic in controllers
Queue long-running tasks via HorizonSkip validation on user input
Write comprehensive tests (>85% coverage)Ignore queue failures