Langsung ke konten
Skillpedia
API & server (backend)12k Β· #11434

laravel-specialist

Fungsinya

Skill ini memandu agent AI untuk membangun aplikasi web dan API PHP dengan framework Laravel. Skill ini untuk pengembang yang membangun sistem backend atau halaman interaktif dengan Laravel.

Kapan dipakai

  • βœ“Saat Anda membuat model Eloquent dengan relasi dan scope.
  • βœ“Saat Anda perlu mengatur login Sanctum atau worker antrean untuk pekerjaan latar belakang.
  • βœ“Saat Anda ingin komponen Livewire atau API RESTful dengan resource API.

Link skill

https://github.com/Jeffallan/claude-skills/blob/main/skills/laravel-specialist/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/Jeffallan/claude-skills/blob/main/skills/laravel-specialist/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBangun API Laravel untuk aplikasi pemesanan dengan login Sanctum dan konfirmasi email yang masuk antrean.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent merencanakan database dan layanan, membuat model dan rute, lalu menambahkan job untuk pekerjaan latar belakang. Sebelum menganggap satu langkah selesai, agent menjalankan rangkaian tes.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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:

Topic Reference Load When
Eloquent ORM references/eloquent.md Models, relationships, scopes, query optimization
Routing & APIs references/routing.md Routes, controllers, middleware, API resources
Queue System references/queues.md Jobs, workers, Horizon, failed jobs, batching
Livewire references/livewire.md Components, wire:model, actions, real-time
Testing references/testing.md Feature 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 Us
Pertanyaan umum

Versi Laravel apa yang menjadi target?

Targetnya Laravel 10 ke atas, dengan PHP 8.2 atau yang lebih baru.

Apakah job latar belakang juga dicakup?

Ya. Skill ini mencakup antrean, worker, Horizon, job yang gagal, dan batching.

Bagaimana skill ini menguji aplikasi?

Skill ini menulis tes fitur dan unit dengan Pest atau PHPUnit, dan menargetkan cakupan lebih dari 85 persen.

Detail

Deskripsi asli dari pembuat

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.

repo: Jeffallan/claude-skills

Popularitas

Bintang GitHub
12k
Peringkat
#11434
Lisensi
MIT
Diperbarui
30/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa