laravel-best-practices

Provide Laravel development best practices for code quality, security, and performance.

1|Updated May 24, 2026
One-click install
npx skills add https://github.com/PTKDrake/FIT-vmu --skill laravel-best-practices-ptkdrake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/PTKDrake/FIT-vmu/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/PTKDrake/FIT-vmu --skill laravel-best-practices-ptkdrake

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to applying best practices in Laravel development, helping developers write efficient, secure, and maintainable code.

Core Features & Use Cases

  • Best Practices Guide: Access detailed guidelines for every aspect of Laravel development, including controllers, models, migrations, form requests, policies, jobs, and more.
  • Security Patterns: Learn about security best practices, including input validation, output escaping, and preventing SQL injection.
  • Performance Optimization: Gain insights into database performance, caching strategies, and query optimization.

Quick Start

Use the laravel-best-practices skill to review and refactor your existing Laravel codebase to follow best practices.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
What are the best practices for Laravel controller and model architecture?

Laravel best practices for controllers and models involve extracting business logic into dedicated service classes, utilizing form requests for input validation, and implementing policies for authorization to ensure optimal code quality and maintainable architecture.

How do I optimize Laravel Eloquent queries for better performance?

To optimize Laravel Eloquent queries for performance, apply best practices like avoiding the N+1 query problem using eager loading, implementing caching strategies, and refining database queries to reduce unnecessary overhead and improve response times.

How do I secure Laravel applications against SQL injection and vulnerabilities?

Securing Laravel applications requires following security best practices such as strict input validation via form requests, proper output escaping, and using parameterized Eloquent queries to prevent SQL injection and protect against vulnerabilities.

Do I need prior Laravel knowledge to apply these development best practices?

Yes, applying these Laravel development best practices requires existing knowledge of the Laravel framework and basic coding skills to effectively refactor codebases, implement scheduled commands, and optimize job queues.

What is the best way to refactor an existing Laravel codebase for maintainability?

The best way to refactor a Laravel codebase for maintainability is to migrate business logic into service classes, enforce security through policies, optimize migrations, and streamline scheduled commands and jobs according to established guidelines.

When should I use Laravel jobs and scheduled commands in my application?

Use Laravel jobs and scheduled commands when processing tasks asynchronously or automating recurring maintenance, following best practices to ensure these components integrate cleanly without degrading application performance.