# Laravel — The PHP Framework for Web Artisans > Laravel is an expressive, elegant PHP web framework. Provides routing, Eloquent ORM, Blade templates, queues, events, broadcasting, and a rich ecosystem (Forge, Vapor, Nova, Livewire). The most popular PHP framework by a wide margin. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash composer create-project laravel/laravel my-app cd my-app php artisan serve # Visit http://localhost:8000 ``` ```bash php artisan make:model Asset -mcr # Creates: Model, Migration, Controller (resource) ``` ```php // database/migrations/xxxx_create_assets_table.php public function up(): void { Schema::create("assets", function (Blueprint $table) { $table->id(); $table->string("repo")->unique(); $table->integer("stars")->default(0); $table->text("description")->nullable(); $table->timestamps(); }); } ``` ```php // app/Models/Asset.php class Asset extends Model { protected $fillable = ["repo", "stars", "description"]; } ``` ```php // routes/api.php Route::get("/assets", function () { return Asset::orderByDesc("stars")->limit(10)->get(); }); ``` ```bash php artisan migrate php artisan tinker > Asset::create(["repo" => "react", "stars" => 230000]); ``` ## Intro Laravel is the most popular PHP framework, created by Taylor Otwell in 2011. Its philosophy: web development should be an enjoyable, creative experience. Laravel provides an expressive, elegant syntax with a comprehensive ecosystem: Eloquent ORM, Blade templates, queues, events, broadcasting, Forge (server management), Vapor (serverless), and Livewire (reactive UI without JS). - **Repo**: https://github.com/laravel/laravel - **Stars**: 84K+ - **Language**: PHP - **License**: MIT ## What Laravel Does - **Routing** — expressive route definitions - **Eloquent ORM** — ActiveRecord pattern, relationships, scopes - **Blade templates** — lightweight, compiled template engine - **Artisan CLI** — code generation, migrations, tinker REPL - **Queues** — Redis, SQS, database queue drivers - **Events and broadcasting** — event-driven + WebSocket (Reverb) - **Auth** — sessions, API tokens (Sanctum), OAuth (Passport) - **Livewire** — reactive frontend components in PHP - **Testing** — PHPUnit + Pest integration - **Inertia.js** — SPA without building an API ## Architecture MVC: Models (Eloquent), Views (Blade), Controllers. Service container provides IoC/DI. Facades wrap services for static-like syntax. Middleware pipeline for request/response processing. SOLID principles and PSR standards throughout. ## Self-Hosting ```bash # Production on Linux + Nginx composer install --optimize-autoloader --no-dev php artisan config:cache php artisan route:cache php artisan view:cache ``` Or use Laravel Forge (automated server provisioning) or Vapor (serverless on AWS Lambda). ## Key Features - Eloquent ORM - Blade templates - Artisan CLI - Queue system - Broadcasting (Reverb WebSocket) - Sanctum API auth - Livewire for reactive UI - Inertia.js for modern SPAs - Pest testing framework - Laravel Forge and Vapor ecosystem ## Comparison | Framework | Language | Style | Ecosystem | |---|---|---|---| | Laravel | PHP | Elegant, batteries | Largest PHP | | Symfony | PHP | Components, enterprise | Large | | Django | Python | Batteries-included | Large | | Rails | Ruby | Convention > config | Large | | NestJS | TypeScript | Angular-inspired | Large | | Spring Boot | Java | Enterprise | Largest Java | ## FAQ **Q: Laravel vs Symfony?** A: Laravel is more opinionated, faster to develop with, and has great DX; Symfony is more modular, enterprise-grade, with reusable components (in fact, Laravel uses many Symfony components under the hood). **Q: Livewire replaces React?** A: For moderately interactive apps, yes. Livewire lets you write reactive UIs in PHP, skipping the frontend/backend split. For very complex interactions, React/Vue + Inertia is still recommended. **Q: Performance concerns?** A: With PHP 8.3 + OPcache + route/config cache + Octane (Swoole/FrankenPHP), performance rivals Node.js. ## Sources - Docs: https://laravel.com/docs - GitHub: https://github.com/laravel/laravel - License: MIT --- Source: https://tokrepo.com/en/workflows/laravel-php-framework-web-artisans-cc164e67 Author: Script Depot