PluginBench
Skill
Pass
Audit score 90

laravel-specialist

jeffallan/claude-skills

Build Laravel 10+ applications with Eloquent models, Sanctum auth, queues, APIs, and Livewire components.

What is laravel-specialist?

A senior Laravel specialist skill for implementing Laravel 10+ features including Eloquent ORM, authentication, queue systems, RESTful APIs, and reactive interfaces. Use when creating models, setting up authentication flows, configuring job queues, building Livewire components, optimizing queries, or writing tests.

  • Create and configure Eloquent models with relationships, scopes, and type-safe casts
  • Implement Sanctum authentication flows and API token management
  • Design and build RESTful APIs with API resources and proper data transformation
  • Configure Laravel Horizon for queue management and job processing
  • Build reactive interfaces with Livewire components and real-time updates
  • Write comprehensive feature and unit tests with >85% coverage using Pest/PHPUnit

How to install laravel-specialist

npx skills add https://github.com/jeffallan/claude-skills --skill laravel-specialist
Prerequisites
  • Laravel 10+ installed and configured
  • PHP 8.2+ with typed properties and enums support
  • Composer for dependency management
  • Database configured and migrations set up
Claude Code
Cursor
Windsurf
Cline

How to use laravel-specialist

  1. 1.Analyze requirements to identify models, relationships, APIs, and queue needs
  2. 2.Design database schema and service layer architecture
  3. 3.Create Eloquent models using `php artisan make:model` and verify with `php artisan migrate:status`
  4. 4.Implement controllers, services, API resources, and jobs; verify routes with `php artisan route:list`
  5. 5.Write feature and unit tests and run `php artisan test` to achieve >85% coverage

Use cases

Good for
  • Building a multi-tenant SaaS application with user authentication and role-based access
  • Creating a REST API with complex data relationships and eager-loading optimization
  • Setting up background job processing for email notifications, image processing, or data exports
  • Developing real-time dashboard components with Livewire for live data updates
  • Implementing queue workers with Horizon for monitoring and managing failed jobs
Who it's for
  • Backend developers building Laravel applications
  • Full-stack developers implementing Laravel APIs and frontend components
  • DevOps engineers configuring queue systems and job workers
  • QA engineers writing comprehensive test coverage for Laravel features

laravel-specialist FAQ

When should I use this skill?

Use it when creating Laravel models, setting up queue workers, implementing Sanctum authentication, building Livewire components, optimizing Eloquent queries, or writing tests for Laravel features.

What PHP version is required?

PHP 8.2+ is required to use modern features like readonly properties, enums, and typed properties that this skill leverages.

How do I verify my implementation is correct?

Run validation checkpoints: `php artisan migrate:status` after migrations, `php artisan route:list` after routing, `php artisan queue:work --once` after job dispatch, and `php artisan test --coverage` to verify >85% test coverage.

What testing framework does this skill use?

The skill supports both Pest PHP and PHPUnit for writing feature and unit tests, with templates and examples provided for Pest.

How do I avoid N+1 query problems?

Always use eager loading with `::with()` when querying relationships, and the skill enforces this pattern in all Eloquent model implementations.

Full instructions (SKILL.md)

Source of truth, from jeffallan/claude-skills.


name: laravel-specialist description: Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers, implementing Sanctum auth flows, building Livewire components, optimising Eloquent queries, or writing Pest/PHPUnit tests for Laravel features. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: backend triggers: Laravel, Eloquent, PHP framework, Laravel API, Artisan, Blade templates, Laravel queues, Livewire, Laravel testing, Sanctum, Horizon role: specialist scope: implementation output-format: code related-skills: fullstack-guardian, test-master, devops-engineer, security-reviewer

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

More from jeffallan/claude-skills and the wider catalog.

GO

golang-pro

jeffallan/claude-skills

Senior Go developer for concurrent systems, microservices, and production-grade performance optimization.

15k installsAudited
FL

flutter-expert

jeffallan/claude-skills

Senior Flutter engineer for cross-platform apps with Riverpod, Bloc, GoRouter, and performance optimization.

12k installsAudited
PH

php-pro

jeffallan/claude-skills

Senior PHP developer for modern PHP 8.3+, Laravel, Symfony with strict typing, PHPStan level 9, and enterprise patterns.

12k installsAudited
KU

kubernetes-specialist

jeffallan/claude-skills

Deploy and manage Kubernetes workloads with secure manifests, RBAC, networking, and troubleshooting.

11k installs
DE

devops-engineer

jeffallan/claude-skills

Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates. Handles deployment automation, GitOps configuration, incident response runbooks, and internal developer platform tooling. Use when setting up CI/CD pipelines, containerizing applications, managing infrastructure as code, deploying to Kubernetes clusters, configuring cloud platforms, automating releases, or responding to production incidents. Invoke for pipelines, Docker, Kubernetes, GitOps, Terraform, GitHub Actions, on-call, or platform engineering.

6.8k installs
SP

spring-boot-engineer

jeffallan/claude-skills

Generates Spring Boot 3.x configurations, creates REST controllers, implements Spring Security 6 authentication flows, sets up Spring Data JPA repositories, and configures reactive WebFlux endpoints. Use when building Spring Boot 3.x applications, microservices, or reactive Java applications; invoke for Spring Data JPA, Spring Security 6, WebFlux, Spring Cloud integration, Java REST API design, or Microservices Java architecture.

6.8k installsAudited