Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -42,5 +42,7 @@
"allow-plugins": {
"pixelfear/composer-dist-plugin": true
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
37 changes: 30 additions & 7 deletions tests/MigrateAssetContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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'),
Expand All @@ -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);
}
Expand Down