# Upgrade Plan: Laravel 8 to Latest (Laravel 11.x)

This plan outlines the steps to upgrade the application from Laravel 8 to the latest stable version (Laravel 11.x). This is a major upgrade that must be done incrementally to ensure stability.

## Current State
- **Laravel Framework**: 8.x
- **PHP Version**: ^7.3|^8.0 (Configured in composer.json)

## Target State
- **Laravel Framework**: 11.x
- **PHP Version**: 8.2+

## Upgrade Strategy
We will follow the official upgrade guides incrementally: 8 -> 9 -> 10 -> 11.

### Phase 1: Preparation & Environment
- [x] Ensure Docker/Sail environment uses a compatible PHP version (start with PHP 8.1 or 8.2 in Dockerfile to support intermediate upgrades).
- [x] Update `composer.json` dependencies to be compatible with newer PHP versions.
- [x] Verify test suite passes on current version: `make test-api`

### Phase 2: Upgrade to Laravel 9
- [x] Update `laravel/framework` to `^9.0`.
- [x] Update `nunomaduro/collision` to `^6.1`.
- [x] Replace `fruitcake/laravel-cors` with built-in support.
- [x] Update `facade/ignition` to `spatie/laravel-ignition`.
- [x] Run `composer update`.
- [x] Test application and fix breaking changes.
- [x] Verify all tests pass: `make test-api`

### Phase 3: Upgrade to Laravel 10
- [x] Update `laravel/framework` to `^10.0`.
- [x] Update `spatie/laravel-ignition` to `^2.0`.
- [x] Update `phpunit/phpunit` to `^10.0` (optional but recommended).
- [x] Run `composer update`.
- [x] Test application (dispatchNow removal, etc.).
- [x] Verify all tests pass: `make test-api`

### Phase 4: Upgrade to Laravel 11
- [x] Update `laravel/framework` to `^11.0`.
- [x] Update `laravel/sanctum` and other first-party packages.
- [x] Adjust application structure (optional: Laravel 11 has a streamlined skeleton, but we can keep the existing structure).
- [x] Check for floating-point precision changes and other breaking changes.
- [x] Run `composer update`.
- [x] Final Testing.
- [x] Verify all tests pass: `make test-api`

## Notes
- We will use Docker (Sail) to easily switch PHP versions during the upgrade.
- We will rely heavily on `composer update --with-all-dependencies` to resolve version conflicts.
