# Agent Rules for This Project

## Architecture

- This project is a Laravel API.
- Business logic must be inside Service classes.

## Controllers

- Controllers must remain thin.
- Controllers should only call Service classes.

## Validation

- Use Laravel Form Request classes for all validation.

## API Responses

- Always use successResponse() for successful responses.
- Always use errorResponse() for error responses.

## Media Handling

- Always use Spatie Media Library for handling images and file uploads.
- Do not implement custom file upload logic unless explicitly requested.

## API Testing

- After implementing any API method or endpoint, always provide the corresponding cURL example for testing.
- Replace the token with {{TOKEN}} instead of YOUR_TOKEN_HERE
- Replace the domain with {{url}} instead of YOUR_DOMAIN

## Dashboard
- The dashboard is built using Filament v5.

## Localization

- All user-facing messages must be provided in both Arabic and English using the spatie/laravel-translatable package.
- In the dashboard, if a field is of type JSON, add Arabic and English fields for it.

## Code Quality

- Follow PSR-12 coding standards.
- Do not repeat code.
- Reuse existing logic whenever possible.
