spatie-laravel-php

Applies Spatie coding standards to Laravel and PHP code generation, review, and refactoring.

Updated Nov 29, 2025
One-click install
npx skills add https://github.com/achyutkneupane/Blog-Kit --skill spatie-laravel-php-achyutkneupane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spatie-laravel-php
Source: https://github.com/achyutkneupane/Blog-Kit/tree/main/.ai/skills/spatie-laravel-php
Command: npx skills add https://github.com/achyutkneupane/Blog-Kit --skill spatie-laravel-php-achyutkneupane

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Inconsistent code style across Laravel and PHP projects leads to harder reviews and maintenance. This Skill enforces Spatie's published Laravel and PHP guidelines so generated, edited, or reviewed code follows Laravel conventions and PSR-12 consistently. ## Core Features & Use Cases - Standards Enforcement: Applies PSR-1, PSR-2, PSR-12, typed properties, short nullable syntax, constructor property promotion, and early-return control flow. - Laravel Conventions: Covers routes, controllers, config, validation, Blade templates, migrations, enums, translations, authorization, and testing patterns. - Use Case: When asked to write a new Eloquent controller or refactor a Blade template, the Skill consults its reference guidelines and produces code matching Spatie's style, such as tuple route notation, plural controller names, and array-based validation rules. ## Quick Start Ask the AI to write or refactor a Laravel controller, model, route, or Blade template following Spatie's coding guidelines.

Frequently Asked Questions about spatie-laravel-php

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

FAQPage Schema
How do I apply Spatie coding standards to Laravel code?

Activate the skill whenever creating, editing, or reviewing Laravel or PHP files. It reads the bundled guidelines reference and applies rules for routes, controllers, validation, Blade templates, and general PHP style automatically.

What PHP style rules does Spatie recommend for Laravel?

Key rules include following PSR-12, using typed properties over docblocks, short nullable syntax like ?string, constructor property promotion, early returns instead of else, string interpolation over concatenation, and always using curly braces.

Does this skill work with Blade templates?

Yes, Blade templates are in scope. The guidelines specify 4-space indentation, no spaces after control structures like @if($condition), camelCase view filenames, and using the __() helper instead of @lang for translations.

Can I use these guidelines for non-Laravel PHP projects?

The general PHP standards such as PSR-12, type declarations, and control flow rules apply to any PHP code. However, framework-specific sections on routes, config, and migrations are Laravel-only, and other frameworks are out of scope.

What are the limitations of these coding guidelines?

The skill does not cover JavaScript, TypeScript, CSS, infrastructure, or database schema design. When a rule conflicts with existing project conventions, it defers to Laravel conventions and keeps changes consistent with the codebase.