luiz-balisa/laravel-rules icon
public
Published on 6/7/2025
Laravel Rules

Rules

Build & Development Commands

  • Use Laravel 11 If not Specified.
  • Use PHP 8.3 If not Specified.
  • Use Bootsrap CSS For Default
  • Use FontAwesome CDN For SVG Icons Default.
  • Adhere to Laravel best practices and conventions.
  • Prioritize code iteration and modularization over duplication.
  • Choose descriptive names for variables and methods.
  • Name directories without using space, instead use dashes (e.g., app/Http/Controllers).
  • Prioritize dependency injection and service containers.
  • Comply with PSR-12 coding standards.
  • Utilize Laravel's built-in features and helpers efficiently.
  • Adhere to Laravel's directory structure and naming conventions.
  • Implement effective error handling and logging using Laravel's features, including custom exceptions and try-catch blocks.
  • Employ Laravel's validation for forms and requests.
  • Use middleware for request filtering and modification.
  • Utilize Laravel's Eloquent ORM and query builder for database interactions.
  • Manage dependencies with the latest stable version of Laravel and Composer.
  • Prefer Eloquent ORM over raw SQL queries.
  • Use Laravel's Breezee authentication and authorization features.
  • Utilize caching mechanisms for performance enhancement.
  • Implement job queues for handling long-running tasks.
  • Ensure efficient database indexing for query performance enhancement.
  • Employ Laravel's pagination features for data presentation.
  • Implement comprehensive error logging and monitoring.
  • Follow Laravel's MVC architecture.
  • Use Laravel's routing system to define application endpoints.
  • Implement request validation using Form Requests.
  • Use Laravel's Blade engine for templating views.
  • Establish database relationships with Eloquent.
  • Utilize Laravel's event and listener system for decoupled code functionality.
  • Apply database transactions to maintain data integrity.
  • Use Laravel's scheduling features for managing recurring tasks.

Testing Guidelines

  • Make The Sensitive Routes Secured (Example: API, Login, Register, Etc)
  • Apply CSRF protection and other security measures.

Persona Guidelines

  • You are an expert in Laravel, PHP, and any closely related web development technologies.

Code Style & Guidelines

  • Add an Comment To Explain What The Function Does
  • Add an Comment To Explain How The Code Works
  • Focus To Make Code Efficient
  • Focus To Make Code Performance
  • Focus To Make Code More Readable By Human
  • Write Code Shorter And Still Maintain The Readability By Human

Documentation Guidelines

  • Read The Documentation Carefully
  • Remember Previous Instructions.