From 582162bd7ff8e343caa671e87c967f1f72c0ccd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:26:27 +0000 Subject: [PATCH 1/3] Update spatie/laravel-permission requirement from ^7.0 to ^8.3 Updates the requirements on [spatie/laravel-permission](https://github.com/spatie/laravel-permission) to permit the latest version. - [Release notes](https://github.com/spatie/laravel-permission/releases) - [Changelog](https://github.com/spatie/laravel-permission/blob/main/CHANGELOG.md) - [Commits](https://github.com/spatie/laravel-permission/compare/7.0.0...8.3.0) --- updated-dependencies: - dependency-name: spatie/laravel-permission dependency-version: 8.3.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e9119677..0e12b873 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "illuminate/contracts": "^12.0|^13.0", "livewire/livewire": "^3.0|^4.0", "spatie/laravel-package-tools": "^1.14.0", - "spatie/laravel-permission": "^7.0", + "spatie/laravel-permission": "^8.3", "step2dev/lazy-breadcrumb": "dev-main", "step2dev/lazy-setting": "dev-main", "step2dev/lazy-ui": "dev-2.x-dev", From f6b64a76209ee4022b4c7fa399fc8eabb5aa8284 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Tue, 29 Sep 2026 00:31:19 +0300 Subject: [PATCH 2/3] Migrate laravel-permission to v8 without dropping v7 compatibility --- .github/workflows/run-tests.yml | 18 +++++++++++- composer.json | 2 +- src/Components/Table.php | 23 --------------- src/LazyAdminServiceProvider.php | 2 -- tests/Feature/LazyUi2MigrationTest.php | 20 ++++++------- .../SpatiePermissionCompatibilityTest.php | 28 +++++++++++++++++++ tests/TestCase.php | 18 ++++++++++++ 7 files changed, 74 insertions(+), 37 deletions(-) delete mode 100644 src/Components/Table.php create mode 100644 tests/Feature/SpatiePermissionCompatibilityTest.php diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index be78efd4..e3c02078 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,6 +20,7 @@ jobs: os: [ubuntu-latest, windows-latest] php: [8.5, 8.4] laravel: [13.*, 12.*] + permission: ['^8.3'] stability: [prefer-stable] include: - laravel: 13.* @@ -28,8 +29,22 @@ jobs: - laravel: 12.* testbench: 10.* carbon: '>=3.8.4 <4.0' + - os: ubuntu-latest + php: 8.4 + laravel: 13.* + testbench: 11.* + carbon: '>=3.8.4 <4.0' + permission: '^7.0' + stability: prefer-stable + - os: ubuntu-latest + php: 8.4 + laravel: 12.* + testbench: 10.* + carbon: '>=3.8.4 <4.0' + permission: '^7.0' + stability: prefer-stable - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - Permission ${{ matrix.permission }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code @@ -51,6 +66,7 @@ jobs: run: | composer config audit.block-insecure false composer require --dev "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer require "spatie/laravel-permission:${{ matrix.permission }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies diff --git a/composer.json b/composer.json index 0e12b873..6c671293 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "illuminate/contracts": "^12.0|^13.0", "livewire/livewire": "^3.0|^4.0", "spatie/laravel-package-tools": "^1.14.0", - "spatie/laravel-permission": "^8.3", + "spatie/laravel-permission": "^7.0|^8.3", "step2dev/lazy-breadcrumb": "dev-main", "step2dev/lazy-setting": "dev-main", "step2dev/lazy-ui": "dev-2.x-dev", diff --git a/src/Components/Table.php b/src/Components/Table.php deleted file mode 100644 index 9615d1ed..00000000 --- a/src/Components/Table.php +++ /dev/null @@ -1,23 +0,0 @@ -mergeData($data, [ - 'overflow-x-auto rounded-2xl border border-base-300 bg-base-100', - ]))->render(); - }; - } -} diff --git a/src/LazyAdminServiceProvider.php b/src/LazyAdminServiceProvider.php index 521bb9cc..823228c3 100644 --- a/src/LazyAdminServiceProvider.php +++ b/src/LazyAdminServiceProvider.php @@ -27,7 +27,6 @@ use Step2dev\LazyAdmin\Components\Layout; use Step2dev\LazyAdmin\Components\MenuItem; use Step2dev\LazyAdmin\Components\MenuLabel; -use Step2dev\LazyAdmin\Components\Table as AdminTable; use Step2dev\LazyAdmin\Controllers\AccessController; use Step2dev\LazyAdmin\Controllers\PageController; use Step2dev\LazyAdmin\Controllers\PermissionController; @@ -132,7 +131,6 @@ public function configurePackage(Package $package): void Layout::class, BaseLayout::class, EmptyState::class, - AdminTable::class, LanguageSwitcher::class, MenuItem::class, MenuLabel::class diff --git a/tests/Feature/LazyUi2MigrationTest.php b/tests/Feature/LazyUi2MigrationTest.php index d73667be..230e4b71 100644 --- a/tests/Feature/LazyUi2MigrationTest.php +++ b/tests/Feature/LazyUi2MigrationTest.php @@ -73,12 +73,12 @@ $source = file_get_contents($root.'/'.$view); expect($source) - ->not->toMatch('/class="[^"]*\\bbtn(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\binput(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\bselect(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\bcheckbox(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\bbadge(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\balert(?:-|\\s)/'); + ->not->toMatch('/(?not->toMatch('/(?not->toMatch('/(?not->toMatch('/(?not->toMatch('/(?not->toMatch('/(?toContain('not->toMatch('/class="[^"]*\\bdropdown(?:-|\\s)/'); + ->not->toMatch('/(?not->toContain('@php') - ->not->toMatch('/class="[^"]*\\bdropdown(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\bcollapse(?:-|\\s)/') - ->not->toMatch('/class="[^"]*\\bswap(?:-|\\s)/'); + ->not->toMatch('/(?not->toMatch('/(?not->toMatch('/(?not->toBeNull() + ->and(version_compare(ltrim((string) $version, 'v'), '7.0.0', '>='))->toBeTrue() + ->and(app(AuthorizationManager::class)->roleModel())->toBe(Role::class) + ->and(app(AuthorizationManager::class)->permissionModel())->toBe(Permission::class); +}); + +it('keeps the package constraint compatible with existing v7 installs while allowing v8', function (): void { + $composer = json_decode( + file_get_contents(dirname(__DIR__, 2).'/composer.json'), + true, + 512, + JSON_THROW_ON_ERROR, + ); + + expect($composer['require']['spatie/laravel-permission'] ?? null)->toBe('^7.0|^8.3'); +}); diff --git a/tests/TestCase.php b/tests/TestCase.php index 32375354..298afa16 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,6 +3,7 @@ namespace Step2dev\LazyAdmin\Tests; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Foundation\Testing\Concerns\InteractsWithViews; use Orchestra\Testbench\TestCase as Orchestra; use Spatie\Activitylog\ActivitylogServiceProvider; use Step2dev\LazyAdmin\LazyAdminServiceProvider; @@ -11,6 +12,8 @@ class TestCase extends Orchestra { + use InteractsWithViews { blade as frameworkBlade; } + protected function setUp(): void { parent::setUp(); @@ -20,6 +23,21 @@ protected function setUp(): void ); } + protected function blade(string $template, $data = []) + { + $bufferLevel = ob_get_level(); + + try { + return $this->frameworkBlade($template, $data); + } finally { + if (str_contains($template, ' $bufferLevel) { + ob_end_clean(); + } + } + } + } + protected function getPackageProviders($app) { return [ From 3cbb0623d8c5233f4b3d4f209726ecd31065c71b Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Tue, 29 Sep 2026 00:32:13 +0300 Subject: [PATCH 3/3] Fix permission compatibility test style --- tests/Feature/SpatiePermissionCompatibilityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/SpatiePermissionCompatibilityTest.php b/tests/Feature/SpatiePermissionCompatibilityTest.php index eb5175ea..042c716a 100644 --- a/tests/Feature/SpatiePermissionCompatibilityTest.php +++ b/tests/Feature/SpatiePermissionCompatibilityTest.php @@ -3,9 +3,9 @@ namespace Step2dev\LazyAdmin\Tests\Feature; use Composer\InstalledVersions; -use Step2dev\LazyAdmin\Authorization\AuthorizationManager; use Spatie\Permission\Models\Permission; use Spatie\Permission\Models\Role; +use Step2dev\LazyAdmin\Authorization\AuthorizationManager; it('supports Spatie permission 7 and 8 without changing the admin authorization contract', function (): void { $version = InstalledVersions::getPrettyVersion('spatie/laravel-permission');