Skip to content

Commit 1335c71

Browse files
Supports Laravel 13 (#130)
* Reapply "update dependencies" This reverts commit bb5522d. * Reapply "update testing matrix" This reverts commit edcdf17. * wip * bump `statamic/cms` * wip * Revert "wip" This reverts commit 2cee951. * wip * wip * wip
1 parent edcdf17 commit 1335c71

File tree

3 files changed

+39
-14
lines changed

3 files changed

+39
-14
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
strategy:
1616
matrix:
1717
php: [8.4, 8.5]
18-
laravel: [12.*]
18+
laravel: [12.*, 13.*]
1919
stability: [prefer-lowest, prefer-stable]
2020
os: [ubuntu-latest]
2121
include:
2222
- os: windows-latest
2323
php: 8.5
24-
laravel: 12.*
24+
laravel: 13.*
2525
stability: prefer-stable
2626

2727
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"require": {
55
"php": "^8.4",
66
"friendsofphp/php-cs-fixer": "^3.92.5",
7-
"laravel/framework": "^12.0",
7+
"laravel/framework": "^12.0 || ^13.0",
88
"league/flysystem-aws-s3-v3": "~1.0 || ~3.0",
99
"mustangostang/spyc": "dev-master#dfd9aadc1f5224065d55b42b712c7e99a50a3f4d"
1010
},
1111
"require-dev": {
12-
"statamic/cms": "^6.0.0",
12+
"statamic/cms": "^6.5",
1313
"mockery/mockery": "^1.4.4",
14-
"orchestra/testbench": "^10.0",
15-
"phpunit/phpunit": "^11.0"
14+
"orchestra/testbench": "^10.0 || ^11.0",
15+
"phpunit/phpunit": "^11.0 || ^12.0"
1616
},
1717
"autoload": {
1818
"psr-4": {
@@ -42,5 +42,7 @@
4242
"allow-plugins": {
4343
"pixelfear/composer-dist-plugin": true
4444
}
45-
}
45+
},
46+
"minimum-stability": "dev",
47+
"prefer-stable": true
4648
}

tests/MigrateAssetContainerTest.php

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function it_migrates_disk_with_local_driver()
309309
'public' => [
310310
'driver' => 'local',
311311
'root' => storage_path('app/public'),
312-
'url' => env('APP_URL').'/storage',
312+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
313313
'visibility' => 'public',
314314
'throw' => false,
315315
'report' => false,
@@ -380,7 +380,7 @@ public function it_migrates_disk_with_s3_driver()
380380
'public' => [
381381
'driver' => 'local',
382382
'root' => storage_path('app/public'),
383-
'url' => env('APP_URL').'/storage',
383+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
384384
'visibility' => 'public',
385385
'throw' => false,
386386
'report' => false,
@@ -450,7 +450,7 @@ public function it_migrates_disk_with_terser_key_when_assets_already_exists()
450450
'public' => [
451451
'driver' => 'local',
452452
'root' => storage_path('app/public'),
453-
'url' => env('APP_URL').'/storage',
453+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
454454
'visibility' => 'public',
455455
'throw' => false,
456456
'report' => false,
@@ -526,7 +526,7 @@ public function it_migrates_multiple_disks_with_terser_keys_only()
526526
'public' => [
527527
'driver' => 'local',
528528
'root' => storage_path('app/public'),
529-
'url' => env('APP_URL').'/storage',
529+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
530530
'visibility' => 'public',
531531
'throw' => false,
532532
'report' => false,
@@ -633,7 +633,7 @@ public function it_overwrites_disks_when_forced()
633633
'public' => [
634634
'driver' => 'local',
635635
'root' => storage_path('app/public'),
636-
'url' => env('APP_URL').'/storage',
636+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
637637
'visibility' => 'public',
638638
'throw' => false,
639639
'report' => false,
@@ -813,6 +813,17 @@ protected function normalizeLocalConfig($config)
813813
],
814814
EOT;
815815

816+
// Laravel 13+
817+
$variants[] = <<<'EOT'
818+
'local' => [
819+
'driver' => 'local',
820+
'root' => storage_path('app/private'),
821+
'serve' => false,
822+
'throw' => false,
823+
'report' => false,
824+
],
825+
EOT;
826+
816827
// Current version
817828
$current = <<<'EOT'
818829
'local' => [
@@ -859,8 +870,8 @@ protected function normalizePublicConfig($config)
859870
],
860871
EOT;
861872

862-
// Current version
863-
$current = <<<'EOT'
873+
// Up until Laravel 12.44
874+
$variants[] = <<<'EOT'
864875
'public' => [
865876
'driver' => 'local',
866877
'root' => storage_path('app/public'),
@@ -871,6 +882,18 @@ protected function normalizePublicConfig($config)
871882
],
872883
EOT;
873884

885+
// Current version (Laravel 12.45+)
886+
$current = <<<'EOT'
887+
'public' => [
888+
'driver' => 'local',
889+
'root' => storage_path('app/public'),
890+
'url' => rtrim((string) env('APP_URL'), '/').'/storage',
891+
'visibility' => 'public',
892+
'throw' => false,
893+
'report' => false,
894+
],
895+
EOT;
896+
874897
foreach ($variants as $variant) {
875898
$config = $this->normalizeVariantInConfig($variant, $current, $config);
876899
}

0 commit comments

Comments
 (0)