laravel-guidelines
Laravel Guidelines
This document outlines best practices for building robust, maintainable, and modern Laravel applications. Focus is placed on clean architecture, efficient database usage, and reliable testing strategies.
1. General Principles
- Correctness > Clarity > Consistency > Performance > Cleverness.
- KISS: Keep It Simple, Stupid. Avoid over-engineering.
- DRY (Don't Repeat Yourself): Extract shared logic but be pragmatic. Duplication is cheaper than the wrong abstraction.
- SOLID: Adhere to SOLID principles, with particular emphasis on Single Responsibility (SRP) in classes and methods.
- Strict Typing: Use PHP's strict typing (
declare(strict_types=1);) to ensure type safety. - Config/Env: Prefer
config()and.envvariables over hardcoded strings to ensure flexibility across environments.
2. Modern PHP Features
Leverage modern PHP features for cleaner, more expressive code:
More from stefanmermans/agent-config
react-guidelines
Crucial info when dealing with a React project, these guidelines must always be followed in react contexts.
23python-guidelines
When dealing with python code, these guidelines must always be followed.
22markdown-validation
How to validate markdown files
21vue-guidelines
Essential guidelines for Vue.js development. Always follow these rules when working with Vue project.
19general-coding-guidelines
This skill must always be used when writing or reviewing code or tests in any language or framework.
19markdown-guidelines
When creating or editing markdown files, these guidelines must always be followed.
3