laravel-best-practices

Review and refactor Laravel PHP code for framework best practices.

41|4|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/lartisan/filament-architect --skill laravel-best-practices-lartisan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/lartisan/filament-architect/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/lartisan/filament-architect --skill laravel-best-practices-lartisan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write, review, and refactor Laravel code so backend features stay consistent, secure, performant, and easy to maintain.

Core Features & Use Cases

  • Code Review Guidance: Evaluates controllers, models, migrations, requests, jobs, routes, and Blade views against Laravel conventions.
  • Performance and Safety Patterns: Recommends eager loading, indexing, validation, authorization, and query shaping to prevent common production issues.
  • Architecture Support: Helps choose between actions, services, scopes, policies, queues, and other Laravel patterns for clearer application structure.
  • Use Case: A team can use this Skill to refactor a slow, inconsistent feature into a cleaner implementation that follows the project’s existing Laravel style.

Quick Start

Ask the AI to review your Laravel code and rewrite it using the best-practice patterns that fit the existing project structure.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
How do I refactor a Laravel controller to follow best practices?

To refactor a Laravel controller, move validation logic into form requests and authorization into policies, ensuring the controller remains lean and follows consistent project conventions.

How do I prevent N+1 query problems in Laravel Eloquent?

Prevent N+1 query problems in Laravel Eloquent by applying eager loading patterns, which the Skill identifies and recommends to improve database safety and application performance.

What is the best way to structure a slow Laravel feature for maintainability?

The best way to structure a slow Laravel feature is evaluating architecture patterns like actions, services, scopes, and queues, then rewriting the code to fit the existing project style.

Does this approach support Laravel security reviews and validation?

Yes, this approach supports Laravel security reviews by evaluating authorization, validation, and error handling across controllers, models, routes, and Blade views to prevent production issues.

Can I review Blade views and queued jobs for Laravel conventions?

Yes, you can review Blade views and queued jobs for Laravel conventions, as the Skill evaluates these components against framework-specific patterns for safer and more consistent code.