What problem does it solve?
Laravel coding standards enforce consistent naming, formatting, and architectural guidelines across PHP projects to improve readability, maintainability, and collaboration. It focuses on semantic naming, array structure, validation rules formatting, and enum usage while ignoring indentation, whitespace, and other formatting concerns typically handled by linters.
Core Features & Use Cases
- Naming conventions for variables, constants, classes, interfaces, and enums to ensure uniform coding style.
- Array usage rules including short array syntax, trailing commas, and proper key-value formatting.
- Validation rules structured as arrays instead of pipe-delimited strings for readability and tooling support.
- Enum usage guidelines with labeled methods and option builders.
- Layered architecture guidance separating controllers, services, and repositories to keep business logic out of controllers.
Quick Start
Apply these standards to a Laravel project by reviewing a sample controller for naming, array formatting, and validation structure.