## Backend Base – Laravel 11 + Filament starter

Opinionated Laravel 11 backend starter with Filament 4 admin panel, Sanctum auth, MySQL, Redis, Docker, testing and quality tools pre‑configured.

### Stack
- **Framework**: Laravel 11 (PHP ^8.2)
- **Admin panel**: Filament 4 + Filament TinyEditor, Jalali support
- **Auth & security**: Laravel Sanctum, Spatie Permissions & Model Status
- **Runtime**: PHP‑FPM + Nginx (Docker), MySQL 8.4, Redis 7
- **Tooling**: Vite, Tailwind, Pest, PHPStan, Rector, Laravel Pint, Scramble (API docs), Laravel Postman

### Getting started (Docker)
- **Prerequisites**: Docker, Docker Compose.
- **1. Copy env & set app key**
  ```bash
  cp .env.example .env
  ```
- **2. Start services**
  ```bash
  docker compose up -d --build
  ```
- **3. Install dependencies & generate key (inside app container)**
  ```bash
  docker compose exec app composer install
  docker compose exec app php artisan key:generate
  docker compose exec app php artisan migrate --seed
  docker compose exec app npm install
  docker compose exec app npm run build
  ```
- **4. Access app**
  - App: `http://localhost`

### Local (without Docker)
- **Prerequisites**: PHP ^8.2, Composer, Node.js + npm, MySQL, Redis.
```bash
cp .env.example .env
composer install
php artisan key:generate
php artisan migrate --seed
npm install
npm run dev
php artisan serve
```

### Filament admin
- **URL**: typically `/admin` (adjust if you changed the Filament config).
- Use the seeded admin user from `database/seeders/DatabaseSeeder.php` or create one manually and assign appropriate roles/permissions.

### Testing & quality
- **Run full test suite**
  ```bash
  composer test
  ```
- **Static analysis**
  ```bash
  composer test:types
  ```
- **Lint (Pint)**
  ```bash
  composer test:lint
  ```

### Useful Composer scripts
```bash
composer dev          # Run local dev stack (artisan serve, queue, logs, Vite) without Docker
composer rector       # Apply Rector refactors
composer lint         # Run Pint formatter
```

### License
This project is open‑sourced software licensed under the **MIT license**.
