Laravel 6 Assistant
relace
mistral
voyage
voyage
# AI Assistant Rules for Laravel 6 Projects
This document defines the conventions and rules the AI Assistant must follow when assisting with Laravel 6 projects. Laravel 6 is a Long Term Support (LTS) release, so stability, compatibility, and adherence to framework conventions are essential.
---
## Core Rules for Laravel 6
### 1. Framework Compatibility
- All code must be compatible with Laravel 6.x.
- Do not suggest features introduced in Laravel 7+.
### 2. Routing
- Use `Route::get('uri', 'Controller@method')` syntax.
- Avoid `::class` based controller routes.
- Use routes properly.
**Example:**
```php
Route::get('/users', 'UserController@index');
```
### 3. Authentication
Use `laravel/ui` for auth scaffolding.
```bash
composer require laravel/ui "^1.0"
php artisan ui vue --auth
```
### 4. Eloquent ORM
- Use Laravel 6-supported relationships and query scopes.
- Avoid model casting or relationship features added after Laravel 6.
### 5. Helper Functions
- Use global helpers (`array_get`, `str_slug`, `bcrypt`, etc.)
- Ensure helper functions are not deprecated in Laravel 6.
### 6. Testing
- Use PHPUnit (no Pest).
- Test class naming should follow: `Feature` and `Unit`.
---
## Folder Structure Conventions
```
app/
Console/
Exceptions/
Http/
Controllers/
Auth/
Middleware/
Requests/
Models/ <- Use this if you separate models (optional)
Providers/
config/
database/
factories/
migrations/
seeds/
resources/
js/
lang/
sass/
views/
routes/
api.php
console.php
web.php
tests/
Feature/
Unit/
```
> **Note:** Laravel 6 stores models in `app/` by default. You can create an `app/Models/` folder if preferred.
---
## Naming Conventions
- **Controllers:** `PascalCase + Controller` → `UserController.php`
- **Models:** `Singular PascalCase` → `User.php`
- **Migrations:** `snake_case + timestamp prefix` → `2025_07_29_000000_create_users_table.php`
- **Views:** `snake_case folders and files` → `resources/views/user/profile.blade.php`
- **Routes:** `kebab-case URIs` → `/user-profile`
- **Variables/Methods:** `camelCase` → `$userList`, `getUserData()`
- **Requests:** `PascalCase + Request` → `StorePostRequest.php`
- **Seeders:** `PascalCase + Seeder` → `UsersTableSeeder.php`
---
## AI Assistant Behavior
- Always explain Laravel 6-specific solutions clearly.
- Suggest code using Laravel 6 syntax and features only.
- Never suggest modern packages, features, or methods that are unsupported.
- Never reference Livewire, Jetstream, Inertia, Breeze, or Tailwind CSS unless explicitly installed.
---
No Prompts configured
No Data configured
No MCP Servers configured