# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a Laravel 12 backend application (ipl-backend-v2) using PHP 8.2+.

## Commands

### Development
```bash
composer dev              # Starts server, queue worker, Pail logs, and Vite concurrently
php artisan serve         # Start the development server alone
```

### Setup
```bash
composer setup            # Full setup: install deps, copy .env, generate key, migrate, build assets
composer install          # Install PHP dependencies
php artisan migrate       # Run database migrations
php artisan db:seed       # Seed the database
```

### Testing
```bash
composer test             # Clear config and run all tests
php artisan test          # Run all tests
php artisan test --filter=TestName   # Run a specific test
./vendor/bin/phpunit tests/Unit/ExampleTest.php   # Run a specific test file
```

### Code Style
```bash
./vendor/bin/pint         # Fix code style with Laravel Pint
./vendor/bin/pint --test  # Check code style without fixing
```

### Useful Artisan Commands
```bash
php artisan make:model ModelName -mfsc   # Create model with migration, factory, seeder, controller
php artisan make:controller ControllerName
php artisan queue:listen                  # Process queue jobs
php artisan pail                          # Real-time log viewer
php artisan tinker                        # Interactive REPL
```

## Architecture

This is a standard Laravel 12 project following conventional structure:
- **app/Models/** - Eloquent models
- **app/Http/Controllers/** - HTTP controllers
- **app/Providers/** - Service providers
- **routes/web.php** - Web routes
- **routes/console.php** - Artisan commands
- **database/migrations/** - Database migrations
- **database/factories/** - Model factories for testing
- **database/seeders/** - Database seeders
- **tests/Unit/** - Unit tests
- **tests/Feature/** - Feature/integration tests
- **bootstrap/app.php** - Application configuration (middleware, exceptions, routing)

## Database

Default configuration uses SQLite (`database/database.sqlite`). Tests use in-memory SQLite.

## Testing Notes

Tests extend `Tests\TestCase`. The phpunit.xml configures a separate testing environment with:
- In-memory SQLite database
- Array-based cache and session
- Sync queue connection
