# PHP 8.2 / Laravel 10 upgrade

The application requires PHP 8.2 or newer and Composer 2.2 or newer. Composer
resolves dependencies against PHP 8.2.0 so the lock file remains installable on
PHP 8.2. PHPUnit remains on the compatible 9.6 release series.

## Deployment

1. Use PHP 8.2 for the web server, CLI, scheduler, and queue workers.
2. Run `composer install --no-dev --optimize-autoloader`.
3. Run `php artisan migrate --force` to add Sanctum's nullable `expires_at`
   column. Existing tokens retain their previous expiration behavior.
4. Rebuild application caches with `php artisan config:cache` and
   `php artisan view:cache`, then restart queue workers.

Review pending migrations before deployment: this repository already contains
two migrations that create `login_logs`. Do not run `migrate:fresh` against an
existing application database. No application database was migrated as part of
this upgrade.

`FILESYSTEM_DISK` is supported, with `FILESYSTEM_DRIVER` retained as a fallback.
Local disks throw on write failure so document uploads cannot silently record
failed writes after the Flysystem upgrade.

## Verification

Run `composer validate --strict`, `composer check-platform-reqs`, and
`vendor/bin/phpunit --filter FrameworkUpgradeTest` for focused compatibility
checks. Tests use an isolated in-memory SQLite database.

The existing authentication tests cannot complete because the two historical
`login_logs` migrations collide. The original homepage test also expects HTTP
200 although the authenticated homepage redirects guests to login. The user
model uses an externally managed `vendors` table absent from these migrations.
The existing MFA mailable also references a missing `auth.mfacode` view; the
focused mail test verifies the transport independently of that template.

Composer audit reports advisories for Laravel 10 and the existing Dompdf 2
dependency. Addressing these requires a separate dependency upgrade beyond
this requested Laravel 10 target; the audit findings have not been suppressed.

References: [Laravel 9 upgrade](https://laravel.com/docs/9.x/upgrade),
[Laravel 10 upgrade](https://laravel.com/docs/10.x/upgrade), and
[Sanctum 3 upgrade](https://github.com/laravel/sanctum/blob/3.x/UPGRADE.md).
