spatie-laravel-php

Enforce Spatie's Laravel and PHP coding standards across Laravel code and Blade templates.

1.5k|170|Updated Sep 25, 2024
One-click install
npx skills add https://github.com/relaticle/relaticle --skill spatie-laravel-php-relaticle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spatie-laravel-php
Source: https://github.com/relaticle/relaticle/tree/main/.claude/skills/spatie-laravel-php
Command: npx skills add https://github.com/relaticle/relaticle --skill spatie-laravel-php-relaticle

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Spatie's Laravel & PHP guidelines provide a unified standard to ensure Laravel code and Blade templates follow predictable conventions, readability, and maintainability across teams.

Core Features & Use Cases

  • Read references/spatie-laravel-php-guidelines.md and apply core Laravel principles, PSR-12 rules, and translation conventions.
  • Enforce consistent coding practices for controllers, models, routes, config, validation, migrations, and tests in Laravel projects.
  • Use the guidelines to review, refactor, format, and generate Laravel/PHP code that adheres to Spatie's standards.

Quick Start

Follow the guidelines by referencing references/spatie-laravel-php-guidelines.md when starting a Laravel/PHP task.

Frequently Asked Questions about spatie-laravel-php

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

FAQPage Schema
How do I enforce Spatie's Laravel and PHP coding standards in my project?

To enforce Spatie's Laravel coding standards, apply PSR-12 rules and specific guidelines for typed properties, explicit return types, and constructor property promotion across controllers, Eloquent models, routes, config, validation, migrations, tests, and Blade templates.

What coding conventions does this approach apply to Laravel Blade templates?

For Laravel Blade templates, this approach applies Spatie's guidelines to ensure predictable conventions, readability, and maintainability across teams, alongside core Laravel principles and PSR-12 standards.

Do I need PSR-12 compliance to use these Laravel code formatting rules?

Yes, PSR-12 compliance is required as these Laravel code formatting rules impose PSR-12 standards alongside specific Spatie conventions like early returns and Laravel translation helpers.

What's the best way to standardize Eloquent models and controllers across a Laravel team?

The best way to standardize Eloquent models and controllers is to apply unified guidelines that enforce typed properties, explicit return types, and constructor property promotion, ensuring consistency and readability across the Laravel project.

Can I use these standards to refactor existing PHP code and migrations?

Yes, you can use these standards to review, refactor, format, and generate PHP code and migrations, ensuring that existing Laravel projects adhere to Spatie's predictable conventions and maintainability standards.