php-guidelines-from-spatie

Enforce PHP and Laravel coding guidelines across Laravel projects.

Updated Sep 5, 2020
One-click install
npx skills add https://github.com/dtorras/dotfiles --skill php-guidelines-from-spatie-dtorras
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-guidelines-from-spatie
Source: https://github.com/dtorras/dotfiles/tree/main/config/claude/skills/php-guidelines-from-spatie
Command: npx skills add https://github.com/dtorras/dotfiles --skill php-guidelines-from-spatie-dtorras

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured set of PHP and Laravel guidelines to improve code readability, consistency, and maintainability across projects.

Core Features & Use Cases

  • Enforces PHP standards (PSR-1, PSR-2, PSR-12) and modern syntax
  • Promotes typed properties and explicit return types to reduce bugs
  • Clarifies docblock usage and class structure for clearer API contracts
  • Applies to Laravel projects to standardize conventions, naming, and architecture
  • Example: refactor a Laravel service to use typed properties and consistent style

Quick Start

Audit a sample Laravel module and apply the PHP guidelines to improve structure and readability

Frequently Asked Questions about php-guidelines-from-spatie

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

FAQPage Schema
How do I enforce PHP and Laravel coding standards across my projects?

To enforce PHP and Laravel coding standards, apply structured guidelines that standardize naming, type declarations, docblocks, and control flow. This ensures code readability, consistency, and maintainability across projects.

What are the best practices for writing docblocks and type declarations in Laravel?

Best practices for docblocks and type declarations in Laravel involve using typed properties and explicit return types to reduce bugs. Clarifying docblock usage and class structure ensures clearer API contracts and better code quality.

How do I refactor a Laravel service to use typed properties and consistent style?

To refactor a Laravel service with typed properties and consistent style, audit the module and apply PHP guidelines covering PSR-12 and modern syntax. This standardizes conventions and improves overall structure and readability.

Does this approach support modern PHP syntax and PSR-12 standards?

Yes, this approach supports modern PHP syntax and enforces PSR-1, PSR-2, and PSR-12 standards. It promotes typed properties and explicit return types to standardize conventions, naming, and architecture in Laravel projects.

When do I need PHP coding guidelines for my Laravel architecture?

You need PHP coding guidelines when you want to standardize conventions, naming, and architecture across Laravel projects. They provide a structured set of rules to improve code readability and maintainability for teams.