# 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 (teknologi-kita-backend-laravel) using PHP 8.2+.

## Commands

### Development
```bash
# Run full development environment (Laravel server, queue worker, Pail logs, and Vite)
composer dev

# Or run only the Laravel dev server (optional custom port)
php artisan serve --port=8000
```

### Setup
```bash
# Full setup (recommended): installs deps, copies .env, generates app key, runs migrations, builds assets
composer setup

# Alternatively, run setup steps manually
composer install
# Copy .env (Unix/macOS/WSL)
cp .env.example .env
# On Windows (PowerShell):
copy .env.example .env
php artisan key:generate
php artisan migrate
php artisan db:seed
```

### 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
