php-patterns

Provides modern PHP patterns and best practices for Laravel, Symfony, and PHP 8+.

1.1k|92|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/lee-to/ai-factory --skill php-patterns-lee-to
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-patterns
Source: https://github.com/lee-to/ai-factory/tree/main/skills/_templates/php/php-patterns
Command: npx skills add https://github.com/lee-to/ai-factory --skill php-patterns-lee-to

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often suffer from inconsistent patterns, boilerplate duplication, and maintenance challenges as teams scale. This skill provides a structured set of modern PHP patterns and best practices to help developers write clean, maintainable, and testable code across Laravel, Symfony, PHP 8+, PSR standards, and related tooling.

Core Features & Use Cases

  • Comprehensive patterns guidance for Laravel, Symfony, and modern PHP features.
  • Guided examples demonstrating type safety, service architectures, repositories, and testing strategies.
  • Use cases include building robust APIs, command-line tools, and scalable services with strong typing and test coverage.

Quick Start

Review the guide's examples and begin refactoring a PHP module to apply modern patterns and best practices.

Frequently Asked Questions about php-patterns

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

FAQPage Schema
What are the best PHP patterns for fixing messy code and improving maintainability?

Modern PHP patterns like strict typing, service architectures, and repositories solve messy code by enforcing PSR-12 standards and testable structures. This skill provides concrete PHP 8+ examples to refactor inconsistent codebases into maintainable Laravel and Symfony applications.

How do I implement strict typing and enums in a PHP 8 application?

Implement strict typing and PHP 8 enums by applying concrete best practice examples that enforce type safety. This skill demonstrates using enums and strict types alongside PSR-12 to build robust, scalable services and command-line tools.

Does this PHP patterns skill work with both Laravel and Symfony frameworks?

Yes, this PHP patterns skill works with both Laravel and Symfony. It provides comprehensive patterns guidance and best practices specifically tailored for building robust applications across both frameworks using modern PHP 8+ features.

How do I set up PHPUnit and Pest testing for a Symfony or Laravel project?

Set up PHPUnit and Pest testing by applying the testable code strategies and concrete guidelines provided by this skill. It demonstrates how to achieve strong test coverage for scalable services built with modern PHP and strict types.

When should I use repository patterns in modern PHP development?

Use repository patterns in modern PHP development when building scalable services and robust APIs that require clean separation of concerns. This skill provides concrete examples of service architectures and repositories for professional development teams.