laravel-code-style

Enforce Laravel coding standards with Pint formatting and PHPStan analysis.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/sasabajic/laravel-best-practice-skills --skill laravel-code-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-code-style
Source: https://github.com/sasabajic/laravel-best-practice-skills/tree/main/laravel-code-style
Command: npx skills add https://github.com/sasabajic/laravel-best-practice-skills --skill laravel-code-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures your Laravel code adheres to industry best practices, improving readability, maintainability, and consistency across your projects.

Core Features & Use Cases

  • Code Formatting: Automatically formats code using Laravel Pint.
  • Static Analysis: Integrates PHPStan/Larastan for detecting code quality issues.
  • Naming Conventions: Provides clear guidelines for naming classes, methods, variables, and database elements.
  • Import Ordering: Enforces a standardized order for PHP imports.
  • Use Case: When writing new controllers or models, this Skill guides you to use consistent naming conventions and ensures your code is automatically formatted and analyzed for potential errors before committing.

Quick Start

Apply Laravel Pint to format the current project's code.

Frequently Asked Questions about laravel-code-style

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

FAQPage Schema
How do I enforce PSR-12 coding standards in a Laravel project?

Enforce PSR-12 coding standards in Laravel by applying automated code formatting with Laravel Pint and running static analysis using PHPStan. This ensures your codebase adheres to industry best practices for readability and maintainability.

What is the best way to automate Laravel code formatting and static analysis?

Automate Laravel code formatting and static analysis by integrating Laravel Pint for style corrections and PHPStan with Larastan for error detection. This combination enforces consistent naming conventions and import ordering across your project.

Does Laravel Pint work with PHPStan for code quality checks?

Yes, Laravel Pint works alongside PHPStan and Larastan to provide comprehensive code quality checks. While Pint handles PSR-12 formatting, PHPStan performs deep static analysis to detect potential errors and maintainability issues.

How do I standardize naming conventions for Laravel models and database schemas?

Standardize naming conventions for Laravel models and database schemas by applying defined rules for classes, methods, variables, and schema elements. This ensures consistency and clarity across your application's architecture and database structure.

Can I use this approach to fix import ordering in my PHP files?

Yes, you can fix import ordering in PHP files by enforcing standardized import ordering rules. This approach automatically organizes your imports, contributing to a cleaner and more consistent codebase across your Laravel application.