diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e1423f0..3bc2731 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,15 +14,18 @@ jobs: matrix: os: [ubuntu-latest] php: [8.1, 8.2] - laravel: [8.*, 9.*, 10.*] + laravel: [9.*, 10.*, 11.*] stability: [prefer-stable] include: - - laravel: 8.* - testbench: ^6.0 - laravel: 9.* testbench: ^7.0 - laravel: 10.* testbench: ^8.0 + - laravel: 11.* + testbench: ^9.0 + exclude: + - laravel: 11.* + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index f49e1e0..bfad46c 100644 --- a/composer.json +++ b/composer.json @@ -18,18 +18,17 @@ "require": { "php": "^8.1", "filament/filament": "^3.0", - "illuminate/contracts": "^10.0", "laravel/horizon": "^5.21", - "laravel/telescope": "^4.16", + "laravel/telescope": "^4.16|^5.0", "spatie/laravel-package-tools": "^1.9.2" }, "require-dev": { "laravel/pint": "^1.13", - "nunomaduro/collision": "^7.0", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.24", - "pestphp/pest-plugin-laravel": "^2.2", - "phpunit/phpunit": "^10.0" + "nunomaduro/collision": "^5.11|^6.4|^7.0|^8.0", + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "pestphp/pest": "^1.4|^2.24", + "pestphp/pest-plugin-laravel": "^1.22|^2.2", + "phpunit/phpunit": "^9.0|^10.0" }, "autoload": { "psr-4": { diff --git a/src/Traits/HasDebuggers.php b/src/Traits/HasDebuggers.php index 6b81310..e5537f9 100755 --- a/src/Traits/HasDebuggers.php +++ b/src/Traits/HasDebuggers.php @@ -6,7 +6,7 @@ trait HasDebuggers { - private function authorized(string $ability): bool + private static function authorized(string $ability): bool { if (config('filament-debugger.authorization')) { return (bool) auth(config('filament.auth.guard'))->user()?->can($ability); @@ -15,20 +15,20 @@ private function authorized(string $ability): bool return true; } - public function telescope(): NavigationItem + public static function telescope(): NavigationItem { return NavigationItem::make() - ->visible($this->authorized(config('filament-debugger.permissions.telescope'))) + ->visible(self::authorized(config('filament-debugger.permissions.telescope'))) ->group(config('filament-debugger.group')) ->url(url: url()->to(config('filament-debugger.url.telescope')), shouldOpenInNewTab: true) ->icon('heroicon-o-sparkles') ->label('Telescope'); } - public function horizon(): NavigationItem + public static function horizon(): NavigationItem { return NavigationItem::make() - ->visible($this->authorized(config('filament-debugger.permissions.horizon'))) + ->visible(self::authorized(config('filament-debugger.permissions.horizon'))) ->group(config('filament-debugger.group')) ->icon('heroicon-o-globe-europe-africa') ->url(url: url()->to(config('filament-debugger.url.horizon')), shouldOpenInNewTab: true) diff --git a/tests/DebuggerTest.php b/tests/DebuggerTest.php index ab5635f..c4f0601 100644 --- a/tests/DebuggerTest.php +++ b/tests/DebuggerTest.php @@ -1,5 +1,6 @@ get(DebuggerPlugin::horizon())->assertSuccessful(); + expect(DebuggerPlugin::horizon())->toBeInstanceOf(NavigationItem::class); }); it('can open telescope', function () { - $this->get(DebuggerPlugin::telescope())->assertSuccessful(); + expect(DebuggerPlugin::telescope())->toBeInstanceOf(NavigationItem::class); });