Synthèse automatique
Fournit des conseils d'expert pour le développement PHP 8.3+, couvrant Laravel 11, Symfony 7, Eloquent ORM et les patterns PHP modernes, y compris les tests et les standards de codage.
Points forts
- Patterns détaillés pour Laravel et Symfony : contrôleurs, modèles, requêtes et ressources API
- Couvre les fonctionnalités modernes de PHP 8.3 : classes readonly, enums, attributs et arguments nommés
- Inclut des stratégies de test avec PHPUnit/Pest et des standards de codage PSR-12/Pint
- Prend en charge la configuration Docker pour PHP-FPM et nginx
Limites
- Limitée à PHP 8.3+, Laravel 11 et Symfony 7 ; les projets plus anciens en bénéficieront peu
- Axée sur le backend, sans couverture du frontend ou des aspects full-stack
- Conçue spécifiquement pour Claude Code, pas pour d'autres assistants IA
Lors du développement ou de la maintenance d'APIs et d'applications web en PHP 8.3+ avec Laravel ou Symfony.
Avec des versions PHP plus anciennes, d'autres frameworks ou du développement backend hors PHP.
Analyse de sécurité
SûrThe skill provides PHP development guidance and patterns. Allowed tools are scoped to PHP ecosystem commands and documentation lookups, posing no execution risk.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Create a Laravel 11 REST API endpoint for users with a UserController, StoreUserRequest, and UserResource, returning JSON responses.Build a Symfony 7 controller using attribute-based routing and Doctrine ORM to persist a User entity and return a JSON response.Write a PHP 8.3 readonly DTO class and a backed enum with methods for an order management domain.name: moai-lang-php description: > PHP 8.3+ development specialist covering Laravel 11, Symfony 7, Eloquent ORM, and modern PHP patterns. Use when developing PHP APIs, web applications, or Laravel/Symfony projects. license: Apache-2.0 compatibility: Designed for Claude Code allowed-tools: Read Grep Glob Bash(php:) Bash(composer:) Bash(phpunit:) Bash(phpstan:) Bash(phpcs:) Bash(artisan:) Bash(laravel:*) mcp__context7__resolve-library-id mcp__context7__get-library-docs user-invocable: false metadata: version: "1.1.0" category: "language" status: "active" updated: "2026-01-11" modularized: "true" tags: "language, php, laravel, symfony, eloquent, doctrine, phpunit"
MoAI Extension: Progressive Disclosure
progressive_disclosure: enabled: true level1_tokens: 100 level2_tokens: 5000
MoAI Extension: Triggers
triggers: keywords: ["PHP", "Laravel", "Symfony", "Eloquent", "Doctrine", "PHPUnit", "Pest", ".php", "composer.json", "artisan"] languages: ["php"]
Quick Reference (30 seconds)
PHP 8.3+ Development Specialist - Laravel 11, Symfony 7, Eloquent, Doctrine, and modern PHP patterns.
Auto-Triggers: PHP files with .php extension, composer.json, artisan command, symfony.yaml, Laravel or Symfony discussions
Core Capabilities:
- PHP 8.3 Features: readonly classes, typed properties, attributes, enums, named arguments
- Laravel 11: Controllers, Models, Migrations, Form Requests, API Resources, Eloquent
- Symfony 7: Attribute-based routing, Doctrine ORM, Services, Dependency Injection
- ORMs: Eloquent for Laravel, Doctrine for Symfony
- Testing: PHPUnit, Pest, feature and unit testing patterns
- Package Management: Composer with autoloading
- Coding Standards: PSR-12, Laravel Pint, PHP CS Fixer
- Docker: PHP-FPM, nginx, multi-stage builds
Quick Patterns
Laravel Controller Pattern:
In the App\Http\Controllers\Api namespace, create a UserController extending Controller. Import StoreUserRequest, UserResource, User, and JsonResponse. Define a store method accepting StoreUserRequest that creates a User using validated data and returns a JsonResponse with UserResource wrapping the user and status 201.
Laravel Form Request Pattern:
In the App\Http\Requests namespace, create a StoreUserRequest extending FormRequest. The authorize method returns true. The rules method returns an array with name requiring required, string, and max 255 validation, email requiring required, email, and unique on users table, and password requiring required, min 8, and confirmed validation.
Symfony Controller Pattern:
In the App\Controller namespace, create a UserController extending AbstractController. Import User, EntityManagerInterface, JsonResponse, and Route attribute. Apply Route attribute at class level for api/users path. Create a create method with Route attribute for empty path and POST method. Inject EntityManagerInterface, create new User, persist and flush, then return json response with user and status 201.
Implementation Guide (5 minutes)
PHP 8.3 Modern Features
Readonly Classes:
Declare a readonly class UserDTO with a constructor promoting public properties for int id, string name, and string email.
Enums with Methods:
Create an OrderStatus enum backed by string. Define cases Pending with pending value, Processing with processing value, and Completed with completed value. Add a label method that uses match expression on $this to return appropriate display labels for each case.
Attributes:
Create a Validate attribute class targeting properties with Attribute attribute. The constructor accepts a string rule and optional string message. Create a UserRequest class with email property decorated with Validate attribute specifying required and email rules.
Laravel 11 Patterns
Eloquent Model with Relationships:
In the App\Models namespace, create a Post model extending Model. Set protected fillable array with title, content, user_id, and status. Set protected casts array with status casting to PostStatus enum and published_at casting to datetime. Define a user method returning BelongsTo relationship. Define a comments method returning HasMany relationship. Add a scopePublished method that filters by published status.
API Resource Pattern:
In the App\Http\Resources namespace, create a PostResource extending JsonResource. The toArray method takes a Request parameter. Return an array with id, title, author using UserResource with whenLoaded for user relationship, comments_count using whenCounted, and created_at formatted as ISO 8601 string.
Migration Pattern:
Create an anonymous migration class extending Migration. The up method calls Schema create on posts table. Define id, foreignId for user_id with constrained and cascadeOnDelete, string for title, text for content, string for status defaulting to draft, timestamps, and softDeletes.
Service Layer Pattern:
In the App\Services namespace, create a UserService class. Define a create method accepting UserDTO. Use DB transaction wrapping User create with data from DTO properties, profile creation with default bio, and returning user with loaded profile relationship. Catch ActiveRecord\RecordInvalid exceptions to handle validation failures.
Symfony 7 Patterns
Entity with Doctrine Attributes:
In the App\Entity namespace, create a User class. Apply ORM\Entity attribute with repositoryClass pointing to UserRepository. Apply ORM\Table attribute with name users. Add private nullable int id with ORM\Id, ORM\GeneratedValue, and ORM\Column attributes. Add private nullable string name with ORM\Column length 255 and Assert\NotBlank. Add private nullable string email with ORM\Column length 180 unique and Assert\Email.
Service with Dependency Injection:
In the App\Service namespace, create a UserService class. The constructor accepts readonly EntityManagerInterface and readonly UserPasswordHasherInterface via property promotion. Define createUser method taking email and password strings. Create new User, set email, hash password using the password hasher, persist with entity manager, flush, and return user.
Testing Patterns
PHPUnit Feature Test for Laravel:
In Tests\Feature namespace, create UserApiTest extending TestCase with RefreshDatabase trait. The test_can_create_user method posts JSON to api/users with name, email, password, and password_confirmation. Assert status 201 and JSON structure with data containing id, name, and email. Assert database has users table with the email.
Pest Test for Laravel:
Use App\Models\User and Post. Create a test using it function for can create a post. Create user with factory. Call actingAs with user, post JSON to api/posts with title and content. Assert status 201 and expect Post count to be 1. Create second test for requires authentication that posts without authentication and asserts status 401.
Advanced Implementation (10+ minutes)
For comprehensive coverage including:
- Production deployment patterns for Docker and Kubernetes
- Advanced Eloquent patterns including observers, accessors, and mutators
- Doctrine advanced mapping with embeddables and inheritance
- Queue and job processing
- Event-driven architecture
- Caching strategies with Redis and Memcached
- Security best practices following OWASP patterns
- CI/CD integration patterns
See:
- modules/advanced-patterns.md for complete advanced patterns guide
Context7 Library Mappings
- laravel/framework for Laravel web framework
- symfony/symfony for Symfony components and framework
- doctrine/orm for Doctrine ORM for PHP
- phpunit/phpunit for PHP testing framework
- pestphp/pest for elegant PHP testing framework
- laravel/sanctum for Laravel API authentication
- laravel/horizon for Laravel queue dashboard
Works Well With
- moai-domain-backend for REST API and microservices architecture
- moai-domain-database for SQL patterns and ORM optimization
- moai-workflow-testing for DDD and testing strategies
- moai-platform-deploy for Docker and deployment patterns
- moai-essentials-debug for AI-powered debugging
- moai-foundation-quality for TRUST 5 quality principles
Troubleshooting
Common Issues:
PHP Version Check:
Run php with version flag to verify 8.3 or later. Use php with -m flag piped to grep for checking pdo, mbstring, and openssl extensions.
Composer Autoload Issues:
Run composer dump-autoload with -o flag for optimized autoloader. Run composer clear-cache to clear the package cache.
Laravel Cache Issues:
Run php artisan config:clear to clear configuration cache. Run php artisan cache:clear to clear application cache. Run php artisan route:clear to clear route cache. Run php artisan view:clear to clear compiled views.
Symfony Cache Issues:
Run php bin/console cache:clear to clear cache. Run php bin/console cache:warmup to warm up the cache.
Database Connection:
Use try-catch block around DB::connection()->getPdo() call. Output success message on connection or exception message on failure.
Migration Rollback:
Use php artisan migrate:rollback with step 1 to rollback last migration. Use php artisan migrate:fresh with seed flag for development reset only. For Symfony, use php bin/console doctrine:migrations:migrate prev to rollback.
Version: 1.1.0 | Updated: 2026-01-11 | Status: Active
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/php-8-3-laravel-symfony-developer-msh3usto/download' --output '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md.part' && mv '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md.part' '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Environnement déclaré par l’auteur : Designed for Claude Code
Outils déclarés par l’auteur (à vérifier dans votre agent) : Read Grep Glob Bash(php:*) Bash(composer:*) Bash(phpunit:*) Bash(phpstan:*) Bash(phpcs:*) Bash(artisan:*) Bash(laravel:*) mcp__context7__resolve-library-id mcp__context7__get-library-docs
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md' && test -s '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/moai-lang-php' && cp -R '.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto' '.claude/skills/moai-lang-php'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/php-8-3-laravel-symfony-developer-msh3usto'openskills read 'php-8-3-laravel-symfony-developer-msh3usto'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/php-8-3-laravel-symfony-developer-msh3usto/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.