moai-lang-php

Implements PHP 8.3 applications using Laravel 11, Symfony 7, Eloquent, and Doctrine patterns.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-php-h102-log
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-lang-php
Source: https://github.com/h102-log/pdfrag/tree/main/.claude/skills/moai-lang-php
Command: npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-php-h102-log

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing modern PHP applications requires keeping up with PHP 8.3 language features, Laravel 11 and Symfony 7 framework conventions, ORM patterns, and testing practices, which is difficult to do consistently without a structured reference. ## Core Features & Use Cases - Modern PHP 8.3 Patterns: Covers readonly classes, enums, attributes, typed properties, match expressions, and nullsafe operators. - Framework Implementation Guides: Provides Laravel 11 patterns (Controllers, Form Requests, API Resources, Eloquent, queues, events) and Symfony 7 patterns (attribute routing, Doctrine ORM, dependency injection). - Testing and Quality Tooling: Includes PHPUnit and Pest test patterns, PHPStan static analysis, Laravel Pint code style, and Docker/CI-CD configuration. - Use Case: When building a REST API in Laravel, use this Skill to scaffold a controller with validated Form Requests, API Resources, Eloquent relationships, and feature tests following current conventions. ## Quick Start Ask the assistant to create a Laravel 11 API endpoint with a Form Request, Eloquent model, API Resource, and a PHPUnit feature test.

Frequently Asked Questions about moai-lang-php

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Laravel 11 API controller with validation?▼

Create a controller extending Controller, inject a Form Request class for validation, and return an API Resource wrapping the model. The Form Request defines rules like required, email, and unique constraints, keeping validation logic out of the controller.

What is the difference between Eloquent and Doctrine ORM?▼

Eloquent is Laravel's Active Record ORM where models handle their own persistence, while Doctrine is Symfony's Data Mapper ORM separating entities from persistence logic. Eloquent favors convention and speed; Doctrine favors explicit mapping with attributes.

Does PHP 8.3 support readonly classes and enums?▼

Yes, PHP 8.3 supports readonly classes where all properties are immutable, and backed enums with methods, constants, and match expressions. Both features are stable and production-ready for typed, predictable code.

Should I use PHPUnit or Pest for Laravel testing?▼

Both work with Laravel; PHPUnit uses class-based test methods while Pest offers a functional, expectation-based syntax with less boilerplate. Pest is built on PHPUnit, so both integrate with artisan test and CI pipelines.

Why does Laravel throw autoload or cache errors after changes?▼

Stale caches or outdated autoloaders cause these errors. Run composer dump-autoload -o to rebuild the autoloader, and clear caches with php artisan config:clear, cache:clear, route:clear, and view:clear.

How do I prevent N+1 query problems in Eloquent?▼

Use eager loading with the with() method to load relationships in a single query, and call Model::preventLazyLoading() in non-production environments to detect accidental lazy loading during development.