Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jeffallan avatar

Laravel Specialist

  • 19k installs
  • 10.8k repo stars
  • Updated May 20, 2026
  • jeffallan/claude-skills

Laravel Specialist is a skill providing architecture and implementation guidance for building Laravel 10+ applications with Eloquent ORM, RESTful APIs, queue systems, and testing.

About

Senior Laravel specialist providing deep expertise in Laravel 10+ and modern PHP 8.2+ development. Covers Eloquent ORM, RESTful API design with API resources, queue systems with Horizon, Livewire components, and comprehensive testing with >85% coverage targets. Use when creating Laravel models, setting up queue workers, implementing Sanctum authentication, or building Livewire components.

  • Eloquent ORM with relationships, scopes, and N+1 optimization
  • RESTful API design with API resources and DTOs
  • Queue system: jobs, workers, Horizon, and batch processing

Laravel Specialist by the numbers

  • 18,961 all-time installs (skills.sh)
  • +508 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #1 of 65 PHP & Laravel skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

laravel-specialist capabilities & compatibility

Capabilities
eloquent orm · rest api design · queue systems · authentication · testing · service architecture
Use cases
api development · database · testing
IDEs
vscode · jetbrains
From the docs

What laravel-specialist says it does

Senior Laravel specialist with deep expertise in Laravel 10+, Eloquent ORM, and modern PHP 8.2+ development.
SKILL.md
npx skills add https://github.com/jeffallan/claude-skills --skill laravel-specialist

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs19k
repo stars10.8k
Security audit3 / 3 scanners passed
Last updatedMay 20, 2026
Repositoryjeffallan/claude-skills

How do you write idiomatic Laravel Eloquent models?

Build Laravel 10+ applications with service-oriented architecture, Eloquent relationships, queue-driven features, and production-grade testing.

Who is it for?

Teams building REST APIs, microservices, and job-driven features in Laravel; developers targeting >85% test coverage

Skip if: Frontend-only work; client-side scripting; projects not using Laravel

When should I use this skill?

An agent is creating or refactoring Laravel Eloquent models, relationships, accessors, or database query patterns.

What you get

PHP model classes with traits, casts, accessors, relationships, and query patterns ready to drop into app/Models.

  • Eloquent models with relationships and scopes
  • RESTful API controllers and resources
  • Feature and unit tests >85% coverage

By the numbers

  • Covers Laravel 10+ and PHP 8.2+
  • >85% test coverage target

Files

SKILL.mdMarkdownGitHub ↗

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 layers, and job queues 3. Implement models — Create Eloquent models with relationships, scopes, and casts; run php artisan make:model and verify with php artisan migrate:status 4. Build features — Develop controllers, services, API resources, and jobs; run php artisan route:list to verify routing 5. Test thoroughly — Write feature and unit tests; run php artisan test before considering any step complete (target >85% coverage)

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Eloquent ORMreferences/eloquent.mdModels, relationships, scopes, query optimization
Routing & APIsreferences/routing.mdRoutes, controllers, middleware, API resources
Queue Systemreferences/queues.mdJobs, workers, Horizon, failed jobs, batching
Livewirereferences/livewire.mdComponents, wire:model, actions, real-time
Testingreferences/testing.mdFeature tests, factories, mocking, Pest PHP

Constraints

MUST DO

  • Use PHP 8.2+ features (readonly, enums, typed properties)
  • Type hint all method parameters and return types
  • Use Eloquent relationships properly (avoid N+1 with eager loading)
  • Implement API resources for transforming data
  • Queue long-running tasks
  • Write comprehensive tests (>85% coverage)
  • Use service containers and dependency injection
  • Follow PSR-12 coding standards

MUST NOT DO

  • Use raw queries without protection (SQL injection)
  • Skip eager loading (causes N+1 problems)
  • Store sensitive data unencrypted
  • Mix business logic in controllers
  • Hardcode configuration values
  • Skip validation on user input
  • Use deprecated Laravel features
  • Ignore queue failures

Code Templates

Use these as starting points for every implementation.

Eloquent Model

<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

final class Post extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = ['title', 'body', 'status', 'user_id'];

    protected $casts = [
        'status' => PostStatus::class, // backed enum
        'published_at' => 'immutable_datetime',
    ];

    // Relationships — always eager-load via ::with() at call site
    public function author(): BelongsTo
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function comments(): HasMany
    {
        return $this->hasMany(Comment::class);
    }

    // Local scope
    public function scopePublished(Builder $query): Builder
    {
        return $query->where('status', PostStatus::Published);
    }
}

Migration

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('posts', function (Blueprint $table): void {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('title');
            $table->text('body');
            $table->string('status')->default('draft');
            $table->timestamp('published_at')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('posts');
    }
};

API Resource

<?php

declare(strict_types=1);

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

final class PostResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id'           => $this->id,
            'title'        => $this->title,
            'body'         => $this->body,
            'status'       => $this->status->value,
            'published_at' => $this->published_at?->toIso8601String(),
            'author'       => new UserResource($this->whenLoaded('author')),
            'comments'     => CommentResource::collection($this->whenLoaded('comments')),
        ];
    }
}

Queued Job

<?php

declare(strict_types=1);

namespace App\Jobs;

use App\Models\Post;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

final class PublishPost implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public int $tries = 3;
    public int $backoff = 60;

    public function __construct(
        private readonly Post $post,
    ) {}

    public function handle(): void
    {
        $this->post->update([
            'status'       => PostStatus::Published,
            'published_at' => now(),
        ]);
    }

    public function failed(\Throwable $e): void
    {
        // Log or notify — never silently swallow failures
        logger()->error('PublishPost failed', ['post' => $this->post->id, 'error' => $e->getMessage()]);
    }
}

Feature Test (Pest)

<?php

use App\Models\Post;
use App\Models\User;

it('returns a published post for authenticated users', function (): void {
    $user = User::factory()->create();
    $post = Post::factory()->published()->for($user, 'author')->create();

    $response = $this->actingAs($user)
        ->getJson("/api/posts/{$post->id}");

    $response->assertOk()
        ->assertJsonPath('data.status', 'published')
        ->assertJsonPath('data.author.id', $user->id);
});

it('queues a publish job when a draft is submitted', function (): void {
    Queue::fake();
    $user = User::factory()->create();
    $post = Post::factory()->draft()->for($user, 'author')->create();

    $this->actingAs($user)
        ->postJson("/api/posts/{$post->id}/publish")
        ->assertAccepted();

    Queue::assertPushed(PublishPost::class, fn ($job) => $job->post->is($post));
});

Validation Checkpoints

Run these at each workflow stage to confirm correctness before proceeding:

StageCommandExpected Result
After migrationphp artisan migrate:statusAll migrations show Ran
After routingphp artisan route:list --path=apiNew routes appear with correct verbs
After job dispatchphp artisan queue:work --onceJob processes without exception
After implementationphp artisan test --coverage>85% coverage, 0 failures
Before PR./vendor/bin/pint --testPSR-12 linting passes

Knowledge Reference

Laravel 10+, Eloquent ORM, PHP 8.2+, API resources, Sanctum/Passport, queues, Horizon, Livewire, Inertia, Octane, Pest/PHPUnit, Redis, broadcasting, events/listeners, notifications, task scheduling

Documentation

Related skills

FAQ

How should I structure Eloquent relationships?

Use typed BelongsTo, HasMany, and related relationship methods; always eager-load via ::with() at call site to avoid N+1 queries.

What testing coverage target should I aim for?

Target >85% coverage using Pest PHP or PHPUnit; run php artisan test before considering any step complete.

Is Laravel Specialist safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

PHP & Laravelbackendtestingdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.