diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 733fe10..f4500e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,11 +17,13 @@ jobs: strategy: fail-fast: true matrix: - php: [8.2, 8.3, 8.4] - laravel: [11, 12] - include: + php: [8.2, 8.3, 8.4, 8.5] + laravel: [11, 12, 13] + exclude: - php: 8.5 - laravel: 12 + laravel: 11 + - php: 8.2 + laravel: 13 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} diff --git a/composer.json b/composer.json index 55f5940..efbc7e6 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,15 @@ "require": { "php": "^8.2", "ext-json": "*", - "illuminate/console": "^11.0|^12.0", - "illuminate/contracts": "^11.0|^12.0", - "illuminate/database": "^11.0|^12.0", - "illuminate/support": "^11.0|^12.0", - "symfony/console": "^7.0" + "illuminate/console": "^11.0|^12.0|^13.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/database": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0", + "symfony/console": "^7.0|^8.0" }, "require-dev": { "mockery/mockery": "^1.6", - "orchestra/testbench": "^9.15|^10.8", + "orchestra/testbench": "^9.15|^10.8|^11.0", "phpstan/phpstan": "^1.10" }, "autoload": { diff --git a/src/SanctumServiceProvider.php b/src/SanctumServiceProvider.php index a50c855..b0f6eca 100644 --- a/src/SanctumServiceProvider.php +++ b/src/SanctumServiceProvider.php @@ -85,8 +85,10 @@ protected function defineRoutes() protected function configureGuard() { Auth::resolved(function ($auth) { - $auth->extend('sanctum', function ($app, $name, array $config) use ($auth) { - return tap($this->createGuard($auth, $config), function ($guard) { + $requestGuardCreator = fn ($config) => $this->createGuard($auth, $config); + + $auth->extend('sanctum', function ($app, $name, array $config) use ($requestGuardCreator) { + return tap($requestGuardCreator($config), function ($guard) { app()->refresh('request', $guard, 'setRequest'); }); });