From a122ccd83c372b10d03a94d029806c46732f22e7 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:46:43 +0000 Subject: [PATCH 01/11] Add 13.x support for Orbit 1.x --- .github/workflows/tests.yml | 4 +++- composer.json | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db1ceea..c398f94 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,13 +14,15 @@ jobs: matrix: os: [ubuntu-latest] php: ['8.2', '8.3', '8.4'] - laravel: ['11.*', '12.*'] + laravel: ['11.*', '12.*', '13.*'] stability: [prefer-lowest, prefer-stable] include: - laravel: 11.* testbench: 9.* - laravel: 12.* testbench: ^10.0 + - laravel: 13.* + testbench: ^11.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index dc18287..c318332 100644 --- a/composer.json +++ b/composer.json @@ -13,15 +13,15 @@ "require": { "php": "^8.0", "ext-json": "*", - "illuminate/console": "^11.0 | ^12.0", - "illuminate/database": "^11.0 | ^12.0", - "illuminate/events": "^11.0 | ^12.0", - "illuminate/support": "^11.0 | ^12.0", + "illuminate/console": "^11.0 | ^12.0 | ^13.0", + "illuminate/database": "^11.0 | ^12.0 | ^13.0", + "illuminate/events": "^11.0 | ^12.0 | ^13.0", + "illuminate/support": "^11.0 | ^12.0 | ^13.0", "spatie/yaml-front-matter": "^2.0", "symfony/yaml": "^6.0 | ^7.0" }, "require-dev": { - "laravel/scout": "^9.4 | ^10.0", + "laravel/scout": "^9.4 | ^10.0 | ^11.0", "nunomaduro/larastan": "^2.0", "orchestra/testbench": "^9.0 | ^10.0", "phpstan/extension-installer": "^1.1", From 369c26d5f7bc3562b4bab62c5c7e76d59dc5f3c8 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:47:48 +0000 Subject: [PATCH 02/11] Exclude PHP 8.2 for 13.x --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c398f94..83a9610 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,6 +23,9 @@ jobs: testbench: ^10.0 - laravel: 13.* testbench: ^11.0 + exclude: + - laravel: 13.* + php: '8.2' name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 041dfa75430344a62a39222b93994c98958495b7 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:48:55 +0000 Subject: [PATCH 03/11] Drop Laravel 11 support --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c318332..31974fa 100644 --- a/composer.json +++ b/composer.json @@ -11,19 +11,19 @@ } ], "require": { - "php": "^8.0", + "php": "^8.2", "ext-json": "*", - "illuminate/console": "^11.0 | ^12.0 | ^13.0", - "illuminate/database": "^11.0 | ^12.0 | ^13.0", - "illuminate/events": "^11.0 | ^12.0 | ^13.0", - "illuminate/support": "^11.0 | ^12.0 | ^13.0", + "illuminate/console": "^12.0 | ^13.0", + "illuminate/database": "^12.0 | ^13.0", + "illuminate/events": "^12.0 | ^13.0", + "illuminate/support": "^12.0 | ^13.0", "spatie/yaml-front-matter": "^2.0", "symfony/yaml": "^6.0 | ^7.0" }, "require-dev": { "laravel/scout": "^9.4 | ^10.0 | ^11.0", "nunomaduro/larastan": "^2.0", - "orchestra/testbench": "^9.0 | ^10.0", + "orchestra/testbench": "^10.0 | ^11.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0 | ^2.0", "phpstan/phpstan-phpunit": "^1.0 | ^2.0", From 04e084e7f2c60195a689487e24b6f5e9764410b6 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:50:00 +0000 Subject: [PATCH 04/11] Remove Laravel 11 from CI --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83a9610..83cb4af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,11 +14,9 @@ jobs: matrix: os: [ubuntu-latest] php: ['8.2', '8.3', '8.4'] - laravel: ['11.*', '12.*', '13.*'] + laravel: ['12.*', '13.*'] stability: [prefer-lowest, prefer-stable] include: - - laravel: 11.* - testbench: 9.* - laravel: 12.* testbench: ^10.0 - laravel: 13.* From 134040bfe6c061b389ad8a09ded2f7f7428cc40d Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:58:29 +0000 Subject: [PATCH 05/11] Simplify dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 31974fa..496733f 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ "symfony/yaml": "^6.0 | ^7.0" }, "require-dev": { - "laravel/scout": "^9.4 | ^10.0 | ^11.0", - "nunomaduro/larastan": "^2.0", + "laravel/scout": "^10.0 | ^11.0", + "nunomaduro/larastan": "^3.0", "orchestra/testbench": "^10.0 | ^11.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0 | ^2.0", From 3460a183eb7a78ed91a07f34f6742b242b42dc35 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 20:59:56 +0000 Subject: [PATCH 06/11] Simplify CI --- .github/workflows/tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83cb4af..e36b4d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ jobs: os: [ubuntu-latest] php: ['8.2', '8.3', '8.4'] laravel: ['12.*', '13.*'] - stability: [prefer-lowest, prefer-stable] include: - laravel: 12.* testbench: ^10.0 @@ -25,7 +24,7 @@ jobs: - laravel: 13.* php: '8.2' - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }} steps: - name: Checkout code @@ -46,7 +45,7 @@ jobs: - name: Install dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.stability }} --prefer-dist --no-interaction + composer update --prefer-dist --no-interaction - name: Execute tests run: vendor/bin/phpunit --colors=always From a4631778746f6ff711cdccd70928adcd4201abb2 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 21:01:43 +0000 Subject: [PATCH 07/11] Keep PHPStan high --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 496733f..491149e 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "illuminate/console": "^12.0 | ^13.0", "illuminate/database": "^12.0 | ^13.0", "illuminate/events": "^12.0 | ^13.0", - "illuminate/support": "^12.0 | ^13.0", + "illuminate/support": "^13.0", "spatie/yaml-front-matter": "^2.0", "symfony/yaml": "^6.0 | ^7.0" }, @@ -27,7 +27,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0 | ^2.0", "phpstan/phpstan-phpunit": "^1.0 | ^2.0", - "phpunit/phpunit": "^10.0 | ^11.5.3" + "phpunit/phpunit": "^11.5.3" }, "extra": { "laravel": { From d4e7e6a6c2d7585282f54c53806b2673a255dcc5 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 21:44:21 +0000 Subject: [PATCH 08/11] Prevent recursive booting --- src/Concerns/Orbital.php | 6 ++++-- tests/TestCase.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Concerns/Orbital.php b/src/Concerns/Orbital.php index f45c411..5cb5421 100644 --- a/src/Concerns/Orbital.php +++ b/src/Concerns/Orbital.php @@ -31,13 +31,15 @@ public static function bootOrbital() $driver = Orbit::driver(static::getOrbitalDriver()); $modelFile = (new ReflectionClass(static::class))->getFileName(); + $instance = (new ReflectionClass(static::class))->newInstanceWithoutConstructor(); + if ( Orbit::isTesting() || filemtime($modelFile) > filemtime(Orbit::getDatabasePath()) || $driver->shouldRestoreCache(static::getOrbitalPath()) || - ! static::resolveConnection()->getSchemaBuilder()->hasTable((new static())->getTable()) + ! static::resolveConnection()->getSchemaBuilder()->hasTable($instance->getTable()) ) { - (new static())->migrate(); + $instance->migrate(); } static::created(function (Model $model) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 0b0163d..642ca77 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,7 +15,7 @@ protected function getPackageProviders($app) ]; } - public function getEnvironmentSetUp($app) + public function defineEnvironment($app) { $app['config']->set('database.default', 'sqlite'); $app['config']->set('database.connections.sqlite.database', ':memory:'); From bf12f3600192a555eb9b82f5c613599071f52e60 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 21:45:33 +0000 Subject: [PATCH 09/11] Fix PHPStan --- phpstan.neon.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 90a0254..4a0559d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,4 +9,3 @@ parameters: tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true - checkMissingIterableValueType: false From 3f68c57f39bab8df2313a16a15d9fd770513f1cc Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 21:46:17 +0000 Subject: [PATCH 10/11] Fix dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 491149e..5bd6a14 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "illuminate/console": "^12.0 | ^13.0", "illuminate/database": "^12.0 | ^13.0", "illuminate/events": "^12.0 | ^13.0", - "illuminate/support": "^13.0", + "illuminate/support": "^12.0 | ^13.0", "spatie/yaml-front-matter": "^2.0", "symfony/yaml": "^6.0 | ^7.0" }, From a3e88349ca310cd1ccb65d6625e387d4968fec03 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Wed, 18 Mar 2026 22:03:22 +0000 Subject: [PATCH 11/11] Make PHPStan happy --- phpstan.neon.dist | 1 - src/Commands/GenerateCommand.php | 6 +++++- src/Concerns/Orbital.php | 1 + src/Concerns/SoftDeletes.php | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4a0559d..d8fd46c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,7 +5,6 @@ parameters: level: 5 paths: - src - - config tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true diff --git a/src/Commands/GenerateCommand.php b/src/Commands/GenerateCommand.php index f381643..fa50d00 100644 --- a/src/Commands/GenerateCommand.php +++ b/src/Commands/GenerateCommand.php @@ -6,6 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\ColumnDefinition; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; class GenerateCommand extends Command @@ -41,7 +42,10 @@ public function handle() protected function getColumnsFromModel(string $modelClass): Collection { - $blueprint = new Blueprint('__orbit:generate__'); + $blueprint = new Blueprint( + DB::connection('orbit'), + Str::snake(Str::pluralStudly(class_basename($modelClass))), + ); /** * @psalm-suppress InvalidStringClass diff --git a/src/Concerns/Orbital.php b/src/Concerns/Orbital.php index 5cb5421..27654e5 100644 --- a/src/Concerns/Orbital.php +++ b/src/Concerns/Orbital.php @@ -16,6 +16,7 @@ use Orbit\Support; use ReflectionClass; +// @phpstan-ignore trait.unused trait Orbital { protected static $orbit; diff --git a/src/Concerns/SoftDeletes.php b/src/Concerns/SoftDeletes.php index 6c53a9f..8f1a6c0 100644 --- a/src/Concerns/SoftDeletes.php +++ b/src/Concerns/SoftDeletes.php @@ -12,6 +12,7 @@ use Orbit\Events\OrbitalUpdated; use Orbit\Facades\Orbit; +// @phpstan-ignore trait.unused trait SoftDeletes { use EloquentSoftDeletes;