Laravel — The PHP Framework for Web Artisans
You are an expert in Laravel, the most popular PHP framework for building web applications and APIs. You help developers build production systems with Eloquent ORM, Blade templating, Artisan CLI, queues, events, middleware, authentication (Sanctum/Breeze), Livewire for reactive UI, and a rich ecosystem of first-party packages — enabling rapid development without sacrificing code quality.
Best use case
Laravel — The PHP Framework for Web Artisans is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
You are an expert in Laravel, the most popular PHP framework for building web applications and APIs. You help developers build production systems with Eloquent ORM, Blade templating, Artisan CLI, queues, events, middleware, authentication (Sanctum/Breeze), Livewire for reactive UI, and a rich ecosystem of first-party packages — enabling rapid development without sacrificing code quality.
Teams using Laravel — The PHP Framework for Web Artisans should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/laravel/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Laravel — The PHP Framework for Web Artisans Compares
| Feature / Agent | Laravel — The PHP Framework for Web Artisans | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
You are an expert in Laravel, the most popular PHP framework for building web applications and APIs. You help developers build production systems with Eloquent ORM, Blade templating, Artisan CLI, queues, events, middleware, authentication (Sanctum/Breeze), Livewire for reactive UI, and a rich ecosystem of first-party packages — enabling rapid development without sacrificing code quality.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Laravel — The PHP Framework for Web Artisans
You are an expert in Laravel, the most popular PHP framework for building web applications and APIs. You help developers build production systems with Eloquent ORM, Blade templating, Artisan CLI, queues, events, middleware, authentication (Sanctum/Breeze), Livewire for reactive UI, and a rich ecosystem of first-party packages — enabling rapid development without sacrificing code quality.
## Core Capabilities
### Eloquent Models
```php
<?php
// app/Models/User.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Casts\Attribute;
class User extends Model
{
use SoftDeletes;
protected $fillable = ['name', 'email', 'password'];
protected $hidden = ['password'];
protected $casts = ['email_verified_at' => 'datetime', 'profile' => 'array'];
public function posts(): HasMany
{
return $this->hasMany(Post::class);
}
// Accessor
protected function name(): Attribute
{
return Attribute::make(
get: fn (string $value) => ucfirst($value),
set: fn (string $value) => strtolower($value),
);
}
// Scope
public function scopeActive($query) { return $query->whereNull('deleted_at'); }
}
```
### Controllers and Routes
```php
<?php
// app/Http/Controllers/UserController.php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function index(Request $request)
{
return User::query()
->when($request->search, fn ($q, $s) => $q->where('name', 'like', "%{$s}%"))
->with('posts')
->paginate(20);
}
public function store(Request $request)
{
$validated = $request->validate([
'name' => 'required|string|max:100',
'email' => 'required|email|unique:users',
'password' => 'required|min:8',
]);
$user = User::create([
...$validated,
'password' => bcrypt($validated['password']),
]);
// Dispatch event
event(new UserRegistered($user));
return response()->json($user, 201);
}
public function show(User $user)
{
return $user->load(['posts' => fn ($q) => $q->published()->latest()->limit(5)]);
}
}
```
```php
// routes/api.php
Route::apiResource('users', UserController::class);
Route::middleware('auth:sanctum')->group(function () {
Route::get('/profile', [ProfileController::class, 'show']);
Route::put('/profile', [ProfileController::class, 'update']);
});
```
### Queues
```php
<?php
// app/Jobs/ProcessOrder.php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class ProcessOrder implements ShouldQueue
{
use InteractsWithQueue, Queueable, SerializesModels;
public int $tries = 3;
public int $backoff = 60;
public function __construct(public Order $order) {}
public function handle(): void
{
$this->order->process();
Mail::to($this->order->user)->send(new OrderConfirmation($this->order));
}
}
// Dispatch: ProcessOrder::dispatch($order)->onQueue('orders');
```
## Installation
```bash
composer create-project laravel/laravel my-app
cd my-app
php artisan serve # Dev server on :8000
php artisan make:model User -mfcr # Model + migration + factory + controller + resource
```
## Best Practices
1. **Eloquent scopes** — Use query scopes for reusable filters: `User::active()->recent()->get()`
2. **Form requests** — Extract validation to FormRequest classes; keeps controllers thin
3. **Eager loading** — Always use `with()` for relations; prevents N+1 queries
4. **Queues for heavy work** — Dispatch jobs for emails, reports, imports; process with `php artisan queue:work`
5. **API resources** — Use API Resources for response transformation; controls serialization per endpoint
6. **Sanctum for auth** — Use Sanctum for SPA/mobile API auth; simple token-based or cookie-based
7. **Migrations are immutable** — Never modify existing migrations; create new ones for changes
8. **Artisan commands** — Create custom commands for maintenance tasks; run via scheduler for cron jobsRelated Skills
microsoft-agent-framework
Create, update, refactor, explain, or review Microsoft Agent Framework solutions using shared guidance plus language-specific references for .NET and Python.
containerize-aspnet-framework
Containerize an ASP.NET .NET Framework project by creating Dockerfile and .dockerfile files customized for the project.
startup-metrics-framework
This skill should be used when the user asks about "key startup metrics", "SaaS metrics", "CAC and LTV", "unit economics", "burn multiple", "rule of 40", "marketplace metrics", or requests guidance on tracking and optimizing business performance metrics.
laravel-security-audit
Security auditor for Laravel applications. Analyzes code for vulnerabilities, misconfigurations, and insecure practices using OWASP standards and Laravel security best practices.
laravel-expert
Senior Laravel Engineer role for production-grade, maintainable, and idiomatic Laravel solutions. Focuses on clean architecture, security, performance, and modern standards (Laravel 10/11+).
framework-migration-legacy-modernize
Orchestrate a comprehensive legacy system modernization using the strangler fig pattern, enabling gradual replacement of outdated components while maintaining continuous business operations through ex
framework-migration-deps-upgrade
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
framework-migration-code-migrate
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
data-quality-frameworks
Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.
backtesting-frameworks
Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.
agent-framework-azure-ai-py
Build Azure AI Foundry agents using the Microsoft Agent Framework Python SDK (agent-framework-azure-ai). Use when creating persistent agents with AzureAIAgentsProvider, using hosted tools (code interpreter, file search, web search), integrating MCP servers, managing conversation threads, or implementing streaming responses. Covers function tools, structured outputs, and multi-tool agents.
agent-framework
Create AI agents and workflows using Microsoft Agent Framework SDK. Supports single-agent and multi-agent workflow patterns. USE FOR: create agent, build agent, scaffold agent, new agent, agent framework, workflow pattern, multi-agent, MCP tools, create workflow. DO NOT USE FOR: deploying agents (use deploy), evaluating agents (use agent/evaluate), Azure AI Foundry agents without Agent Framework SDK.