php-guidelines-from-spatie

Standardize PHP and Laravel coding practices using Spatie guidelines.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This set of PHP and Laravel guidelines from Spatie helps teams write more maintainable, readable, and consistent code across projects.

Core Features & Use Cases

  • Adhere to PHP standards PSR-1, PSR-2, and PSR-12 to unify code style.
  • Favor typed properties, short nullable syntax, and explicit return types to improve type safety.
  • Use proper docblocks judiciously, and import classnames in docblocks to keep references clean.
  • Follow Laravel conventions for routes, controllers, configuration, and artisan commands to ensure predictable structure.
  • Apply explicit naming, formatting, and testing guidelines to reduce technical debt and improve collaboration.

Quick Start

Integrate these guidelines into your codebase and begin refactoring existing PHP/Laravel code to align with the rules.

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 apply Spatie PHP and Laravel coding standards to my existing codebase?

To apply Spatie PHP and Laravel coding standards, integrate these guidelines into your project and refactor existing code to align with PSR-1, PSR-2, PSR-12, and specific Laravel conventions for controllers, routes, and configurations.

What are the PHP best practices for typed properties and docblocks in Laravel?

PHP best practices for typed properties and docblocks in Laravel involve favoring typed properties, using short nullable syntax, defining explicit return types, and importing classnames within docblocks to keep references clean and improve type safety.

Does the Spatie Laravel guidelines skill support PSR-12 formatting and naming conventions?

Yes, the Spatie Laravel guidelines support PSR-12 formatting and naming conventions by specifying explicit requirements for structure, naming, comments, and testing to unify code style and reduce technical debt.

What is the best way to standardize Laravel controller and route configurations across a team?

The best way to standardize Laravel controller and route configurations is to follow Spatie guidelines, which ensure predictable structure by applying specific conventions for artisan commands, configuration files, and routing across the codebase.

Why use Spatie guidelines over general PHP coding standards for Laravel projects?

Using Spatie guidelines over general PHP coding standards provides specialized Laravel conventions for routes, controllers, and configurations, combining PSR standards with strict type safety rules to improve maintainability and collaboration.

When should I refactor PHP code to add explicit return types and typed properties?

You should refactor PHP code to add explicit return types and typed properties when adopting Spatie guidelines, as this improves type safety, ensures predictable structure, and reduces technical debt across your Laravel projects.