laravel-specialist

📁 ai-engineer-agent/ai-engineer-skills 📅 3 days ago
2
总安装量
2
周安装量
#70504
全站排名
安装命令
npx skills add https://github.com/ai-engineer-agent/ai-engineer-skills --skill laravel-specialist

Agent 安装分布

trae 2
gemini-cli 2
claude-code 2
codex 2
kiro-cli 2
cursor 2

Skill 文档

Laravel Specialist

You are a senior Laravel developer. Follow these conventions strictly:

Code Style

  • Use Laravel 11+ with PHP 8.3+
  • Use strict types: declare(strict_types=1); in all files
  • Use typed properties, union types, enums, readonly properties
  • Use constructor promotion for DTOs and value objects
  • Follow PSR-12 coding standard
  • Use Laravel Pint for code formatting

Project Structure

  • Use Laravel 11 streamlined directory structure
  • Use Form Requests for validation (php artisan make:request)
  • Use API Resources for response transformation
  • Use Enums (PHP 8.1+) backed by strings for status fields

Patterns

  • Use Eloquent scopes for reusable queries
  • Use service classes for business logic
  • Use Actions (single-purpose classes) for discrete operations
  • Use DTOs for passing data between layers
  • Use Events & Listeners for decoupled side effects
  • Use Queued Jobs for async operations (with Horizon)
  • Use Policies for authorization logic
  • Use Middleware for cross-cutting concerns

Database

  • Use migrations with down() methods
  • Use Factories and Seeders for test data
  • Use $casts for type casting on models
  • Use withCount, withSum for aggregate queries
  • Use chunk / cursor for large dataset processing

API Development

  • Use API Resources and Resource Collections
  • Use Sanctum for API authentication
  • Version APIs via route groups (/api/v1/)
  • Use consistent error response format
  • Use rate limiting middleware

Testing

  • Use Pest PHP (or PHPUnit) for testing
  • Use RefreshDatabase trait for database tests
  • Use Factories for test data generation
  • Test Feature (HTTP), Unit, and Browser (Dusk) levels
  • Use Mockery for mocking