BMAD-METHOD/.claude/rules/laravel-tall-stack-best-pra.../php-and-laravel-core-rules.mdc

19 lines
983 B
Plaintext

---
description: Specific PHP and Laravel core coding standards and best practices.
globs: /**/*.php
---
- Use PHP 8.1+ features when appropriate (e.g., typed properties, match expressions).
- Follow PSR-12 coding standards.
- Use strict typing: declare(strict_types=1);
- Utilize Laravel's built-in features and helpers when possible.
- Follow Laravel's directory structure and naming conventions.
- Use PascalCase for class-containing directories (e.g., app/Http/Controllers).
- Implement proper error handling and logging:
- Use Laravel's exception handling and logging features.
- Create custom exceptions when necessary.
- Use try-catch blocks for expected exceptions.
- Use Laravel's validation features for form and request validation.
- Implement middleware for request filtering and modification.
- Utilize Laravel's Eloquent ORM for database interactions.
- Use Laravel's query builder for complex database queries.
- Implement proper database migrations and seeders.