diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 88c2465..de87eac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,13 +15,13 @@ jobs: strategy: matrix: php: [8.4, 8.5] - laravel: [12.*] + laravel: [12.*, 13.*] stability: [prefer-lowest, prefer-stable] os: [ubuntu-latest] include: - os: windows-latest php: 8.5 - laravel: 12.* + laravel: 13.* stability: prefer-stable name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index df7fd2f..3b73027 100644 --- a/composer.json +++ b/composer.json @@ -4,15 +4,15 @@ "require": { "php": "^8.4", "friendsofphp/php-cs-fixer": "^3.92.5", - "laravel/framework": "^12.0", + "laravel/framework": "^12.0 || ^13.0", "league/flysystem-aws-s3-v3": "~1.0 || ~3.0", "mustangostang/spyc": "dev-master#dfd9aadc1f5224065d55b42b712c7e99a50a3f4d" }, "require-dev": { - "statamic/cms": "^6.0.0", + "statamic/cms": "^6.5", "mockery/mockery": "^1.4.4", - "orchestra/testbench": "^10.0", - "phpunit/phpunit": "^11.0" + "orchestra/testbench": "^10.0 || ^11.0", + "phpunit/phpunit": "^11.0 || ^12.0" }, "autoload": { "psr-4": { @@ -42,5 +42,7 @@ "allow-plugins": { "pixelfear/composer-dist-plugin": true } - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/tests/MigrateAssetContainerTest.php b/tests/MigrateAssetContainerTest.php index 6dece85..3e06334 100644 --- a/tests/MigrateAssetContainerTest.php +++ b/tests/MigrateAssetContainerTest.php @@ -309,7 +309,7 @@ public function it_migrates_disk_with_local_driver() 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', 'visibility' => 'public', 'throw' => false, 'report' => false, @@ -380,7 +380,7 @@ public function it_migrates_disk_with_s3_driver() 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', 'visibility' => 'public', 'throw' => false, 'report' => false, @@ -450,7 +450,7 @@ public function it_migrates_disk_with_terser_key_when_assets_already_exists() 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', 'visibility' => 'public', 'throw' => false, 'report' => false, @@ -526,7 +526,7 @@ public function it_migrates_multiple_disks_with_terser_keys_only() 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', 'visibility' => 'public', 'throw' => false, 'report' => false, @@ -633,7 +633,7 @@ public function it_overwrites_disks_when_forced() 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', 'visibility' => 'public', 'throw' => false, 'report' => false, @@ -813,6 +813,17 @@ protected function normalizeLocalConfig($config) ], EOT; + // Laravel 13+ + $variants[] = <<<'EOT' + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'serve' => false, + 'throw' => false, + 'report' => false, + ], +EOT; + // Current version $current = <<<'EOT' 'local' => [ @@ -859,8 +870,8 @@ protected function normalizePublicConfig($config) ], EOT; - // Current version - $current = <<<'EOT' + // Up until Laravel 12.44 + $variants[] = <<<'EOT' 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), @@ -871,6 +882,18 @@ protected function normalizePublicConfig($config) ], EOT; + // Current version (Laravel 12.45+) + $current = <<<'EOT' + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => rtrim((string) env('APP_URL'), '/').'/storage', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, + ], +EOT; + foreach ($variants as $variant) { $config = $this->normalizeVariantInConfig($variant, $current, $config); }