0117-spatie-laravel-php-standards

Apply Spatie Laravel and PHP coding standards to PHP and Blade files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0117-spatie-laravel-php-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 0117-spatie-laravel-php-standards
Source: https://github.com/MrJmpl3/codex_____data_____configuration/tree/main/skills/0117-spatie-laravel-php-standards
Command: npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0117-spatie-laravel-php-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of inconsistent Laravel/PHP code style by providing Spatie-aligned conventions that improve readability, maintainability, and conformity to PSR-12.

Core Features & Use Cases

  • Laravel-first formatting rules: Apply Laravel conventions for structure and naming across routes, controllers, config, validation, migrations, and tests.
  • PSR-1/2/12 compliant PHP style: Enforce essentials like curly braces, interpolation over concatenation, and explicit return types (including void).
  • Practical workflow guidance: Read the relevant sections from the included reference and resolve conflicts by preferring Laravel conventions while keeping project consistency.

Quick Start

Apply these Spatie Laravel & PHP guidelines while editing your .php or .blade.php files, ensuring naming, control flow, typing, and string formatting match the reference.

Frequently Asked Questions about 0117-spatie-laravel-php-standards

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

FAQPage Schema
How do I format Laravel code to follow Spatie PHP coding standards?

To format Laravel code to Spatie PHP coding standards, apply PSR-12 rules alongside Laravel-first conventions for controllers, Eloquent models, routes, and migrations. This ensures consistent structure, naming, and explicit type hints across your application artifacts.

What are the PSR-12 style rules for Laravel Blade templates and controllers?

PSR-12 style rules for Laravel Blade templates and controllers require using curly braces, string interpolation over concatenation, and explicit return types including void. You must also enforce early returns and prioritize Laravel-native conventions over conflicting formatting preferences.

Does this coding standard work with Eloquent models and Laravel migrations?

This coding standard works directly with Eloquent models and Laravel migrations by enforcing explicit type hints, return types, and Laravel-native structural conventions. It ensures your database layer and application logic maintain consistent PSR-12 formatting and readability.

How do I resolve conflicts between my personal PHP style preferences and Laravel conventions?

To resolve conflicts between personal PHP style preferences and Laravel conventions, you should always prioritize Laravel conventions to maintain project consistency. The guidelines specifically direct you to prefer Laravel-native formatting rules while keeping your overall codebase aligned.

Do I need explicit return types and void declarations in Laravel validation rules?

Yes, you need explicit return types and void declarations in Laravel validation rules to meet Spatie and PSR-12 coding standards. Enforcing explicit typing across controllers, config, and validation artifacts improves code clarity and maintainability.