|
1 | 1 | # Laravel Boost Guidelines |
2 | 2 | The Laravel Boost Guidelines are specifically curated by Laravel maintainers for this project. These guidelines should be followed closely to help enhance the user's experience and satisfaction. |
3 | 3 |
|
| 4 | +# Foundational Context |
| 5 | +This project is a Laravel app and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure we abide by these specific packages & versions. |
| 6 | + |
| 7 | +- php - {{ PHP_VERSION }} |
| 8 | +@foreach (app(\Laravel\Roster\Roster::class)->packages()->unique(fn ($package) => $package->rawName()) as $package) |
| 9 | + - {{ $package->rawName() }} ({{ $package->name() }}) - v{{ $package->majorVersion() }} |
| 10 | +@endforeach |
| 11 | + |
4 | 12 | @if(!empty(config('boost.project_purpose'))) |
5 | | - <purpose-of-this-project> |
6 | | - {!! config('boost.project_purpose') !!} |
7 | | - </purpose-of-this-project> |
| 13 | + Project purpose: {!! config('boost.project_purpose') !!} |
8 | 14 | @endif |
9 | 15 |
|
10 | | -# Conventions |
11 | | -Follow existing conventions. When creating or editing a file, check sibling files for the correct structure, approach, naming. |
| 16 | +## Conventions |
| 17 | +- You must follow all existing code conventions used in this project. When creating or editing a file, check sibling files for the correct structure, approach, naming. |
| 18 | +- Use descriptive names. e.g. `isRegisteredForDiscounts` not `discount()` |
| 19 | +- Always use strict typing: declare(strict_types=1); |
| 20 | + |
| 21 | +## Project Structure & Architecture |
| 22 | +- Stick to existing directory structure - no new base folders without approval. |
| 23 | +- No dependency changes without approval. |
| 24 | + |
| 25 | +## Constructors |
| 26 | +- Use PHP 8 constructor property promotion in `__construct()` |
| 27 | +<code-snippet>public function __construct(public GitHub $github) { }</code-snippet> |
| 28 | +- Do not allow empty `__construct()` with zero parameters. |
| 29 | + |
| 30 | +## Type Declarations |
| 31 | +- Always use explicit return type declarations for methods and functions. |
| 32 | +- Use appropriate PHP type hints for method parameters. |
| 33 | + |
| 34 | +## Comments |
| 35 | +- Prefer PHPDoc blocks, otherwise use minimal-to-zero comments, unless there is something very complex going on. |
| 36 | + |
| 37 | +## Replies |
| 38 | +- Be concise in your explanations - focus on what's important rather than explaining obvious details. |
| 39 | + |
| 40 | +## Documentation files |
| 41 | +- You must only create documentation files if explicitly requested by the user. |
| 42 | + |
0 commit comments