| description | Use when building Laravel 10+ applications, architecting Eloquent models with complex relationships, implementing queue systems for async processing, or optimizing API performance. Specifically:\n\n<example>\nContext: Building a new Laravel 10 SaaS application from scratch with multi-tenancy, real-time features, and complex database design\nuser: "I need to build a Laravel 10 SaaS platform for task management. Requirements: multi-tenant architecture, real-time notifications via WebSockets, background job processing, Eloquent models with complex relationships, comprehensive API with rate limiting, and 90%+ test coverage."\nassistant: "I'll architect the complete Laravel application: design multi-tenant database schema with scoped Eloquent models, implement Scout full-text search, set up Laravel Echo with WebSockets for real-time updates, configure Horizon for queue management with job batching, create API resources with pagination and filtering, implement Sanctum authentication with rate limiting, write comprehensive Pest tests (90%+ coverage), and optimize with eager loading and caching strategies."\n<commentary>\nInvoke laravel-specialist when building complete Laravel applications from scratch requiring architectural decisions around database design, multi-tenancy, API structure, queue systems, and production-ready patterns. This agent excels at coordinating Laravel's ecosystem components (Eloquent, Horizon, Echo, Sanctum) into cohesive applications.\n</commentary>\n</example>\n\n<example>\nContext: Existing Laravel application experiencing severe N+1 query problems, slow response times, and needs performance optimization without rewriting\nuser: "Our Laravel app has pages taking 5+ seconds to load due to N+1 query problems. We have deeply nested Eloquent relationships, missing indexes, and no caching. How do we profile and optimize without major refactoring?"\nassistant: "I'll implement Laravel performance optimization: use Laravel Debugbar and Clockwork to identify N+1 queries, apply eager loading strategies with include/with, add missing database indexes through migrations, implement Redis caching with cache facades, set up query scopes for optimization, use selectRaw for expensive aggregations, enable query log in production safely, and benchmark critical endpoints before/after optimizations."\n<commentary>\nUse laravel-specialist for performance troubleshooting in existing Laravel applications, specifically addressing N+1 query problems, database optimization, caching strategies, and query profiling. This agent applies Laravel-specific optimization patterns including eager loading, database indexing through migrations, and proper cache invalidation.\n</commentary>\n</example>\n\n<example>\nContext: Legacy Laravel 6 application needs modernization to Laravel 10 with async queues and newer patterns\nuser: "We have a Laravel 6.x app with 200k LOC. Need to upgrade to Laravel 10 incrementally while keeping production stable. Also need to migrate from queue database driver to Redis and adopt newer patterns like Actions and Jobs."\nassistant: "I'll create a phased modernization plan: establish comprehensive Pest test coverage, upgrade Laravel incrementally (6 to 7, 7 to 8, 8 to 9, 9 to 10), address deprecations in each phase, migrate from database queue to Redis, refactor controllers into Action classes and API resources, implement proper error handling with custom exceptions, update authentication to Sanctum, and set up CI/CD with Laravel Pint and PHPStan for code quality."\n<commentary>\nInvoke laravel-specialist for major Laravel version upgrades, modernizing legacy applications, integrating new queue drivers, and adopting contemporary Laravel patterns (Actions, Casts, custom middleware) while managing production stability and preventing regressions.\n</commentary>\n</example> |