diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 74429a4..b5564cc 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -18,26 +18,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.4, 8.3, 8.2, 8.1] - laravel: [10.*, 11.*, 12.*] + php: [8.4, 8.3, 8.2] + laravel: [11.*, 12.*] stability: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* - phpstan_neon: phpstan.laravel-10.neon - laravel: 11.* testbench: 9.* - phpstan_neon: phpstan.neon - laravel: 12.* testbench: 10.* - phpstan_neon: phpstan.neon - exclude: - - laravel: 10.* - php: 8.4 - - laravel: 11.* - php: 8.1 - - laravel: 12.* - php: 8.1 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.os }} @@ -60,4 +48,4 @@ jobs: run: composer show -D - name: Run PHPStan - run: vendor/bin/phpstan --error-format=github --configuration=${{ matrix.phpstan_neon }} + run: vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 42b5f19..4cdc4d5 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -20,23 +20,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.4, 8.3, 8.2, 8.1] - laravel: [10.*, 11.*, 12.*] + php: [8.4, 8.3, 8.2] + laravel: [11.*, 12.*] stability: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* - laravel: 11.* testbench: 9.* - laravel: 12.* testbench: 10.* - exclude: - - laravel: 10.* - php: 8.4 - - laravel: 11.* - php: 8.1 - - laravel: 12.* - php: 8.1 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.os }} diff --git a/README.md b/README.md index e95f2f5..ab2c720 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,13 @@ This plugin allows you to enable one-click logins for your local Filament panels ## Installation +| Filament version | Package version | Readme | +|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------------------------------------------------------------------------------------| +| [^4.x](https://github.com/filamentphp/filament/tree/4.x) | 2.x.x | [Link](https://github.com/DutchCodingCompany/filament-developer-logins/blob/main/README.md) | +| [^3.x](https://github.com/filamentphp/filament/tree/3.x) | 1.x.x | [Link](https://github.com/DutchCodingCompany/filament-developer-logins/blob/1.10.0/README.md) | + + + You can install the package via composer. ```bash @@ -61,33 +68,6 @@ FilamentDeveloperLoginsPlugin::make() ->enabled(app()->environment('local')) ``` -### columns() - -To customize the grid layout, you can use the columns() method. This method allows you to configure the grid layout based on your needs. - -By default, the columns() method sets the grid to 2 columns. You can adjust the default column count or specify different column counts for different screen sizes by passing an array. - -Example: - -```php -// ... -FilamentDeveloperLoginsPlugin::make() - ->columns() // default 2 -``` - -or you can use an array like this - -```php -// ... -FilamentDeveloperLoginsPlugin::make() - ->columns([ - 'sm' => 3, - 'xl' => 6, - '2xl' => 8, - ]) -``` - - ### switchable() By default, a "Switch to" button is shown in the top right corner of the screen, so you can easily switch between the provided users. diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..e6646a5 --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,9 @@ +# Upgrading + +## Upgrading from 1.x to 2.x + +Version 2.x supports filament 4.x and is not compatible with filament 3.x. Below are the breaking changes: + +- The [columns](https://github.com/DutchCodingCompany/filament-developer-logins/tree/1.10.0?tab=readme-ov-file#columns) feature has been removed. If you were using it you need to remove it from the plugin configuration. + +That's it! If you find any bugs please let me know. \ No newline at end of file diff --git a/composer.json b/composer.json index cc0a74b..3508371 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,15 @@ } ], "require": { - "php": "^8.1", - "filament/filament": "^3.0", + "php": "^8.2", + "filament/filament": "^4.0", "spatie/laravel-package-tools": "^1.15.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.8", "larastan/larastan": "^2.9|^3.0", "nunomaduro/collision": "^7.0|^8.1", - "orchestra/testbench": "^8.0|^9.0|^10.0", + "orchestra/testbench": "^9.0|^10.0", "phpunit/phpunit": "^10.0|^11.0", "spatie/laravel-ray": "^1.26" }, @@ -63,6 +63,6 @@ ] } }, - "minimum-stability": "dev", + "minimum-stability": "stable", "prefer-stable": true } diff --git a/phpstan.laravel-10.neon b/phpstan.laravel-10.neon deleted file mode 100644 index 59c3197..0000000 --- a/phpstan.laravel-10.neon +++ /dev/null @@ -1,17 +0,0 @@ -includes: - - ./vendor/larastan/larastan/extension.neon - - phpstan-baseline.neon - -parameters: - level: 7 - - paths: - - database - - src - - tests - - ignoreErrors: - - - message: "#^PHPDoc tag @use contains generic type Illuminate\\\\Database\\\\Eloquent\\\\Factories\\\\HasFactory\\ but trait Illuminate\\\\Database\\\\Eloquent\\\\Factories\\\\HasFactory is not generic\\.$#" - count: 1 - path: tests/Fixtures/TestUser.php diff --git a/resources/views/components/developer-logins.blade.php b/resources/views/components/developer-logins.blade.php index 5b12318..5675a8b 100644 --- a/resources/views/components/developer-logins.blade.php +++ b/resources/views/components/developer-logins.blade.php @@ -1,43 +1,28 @@ @if(count($users) > 0) -
- -
-
-

- {{ __('filament-developer-logins::auth.login-as') }} -

-
-
+
+

+ {{ __('filament-developer-logins::auth.login-as') }} +

@if ($errors->has('developer-logins-failed')) -
-

- {{ $errors->first('developer-logins-failed') }} -

-
+

+ {{ $errors->first('developer-logins-failed') }} +

@endif +
- - @foreach ($users as $label => $credentials) -
- @csrf + @foreach ($users as $label => $credentials) + +
+ @csrf - - + + - - {{ "$label ($credentials)" }} - - - @endforeach - -
+ + {{ "$label ($credentials)" }} + +
+ + @endforeach @endif \ No newline at end of file diff --git a/src/FilamentDeveloperLoginsPlugin.php b/src/FilamentDeveloperLoginsPlugin.php index 514242e..272c760 100644 --- a/src/FilamentDeveloperLoginsPlugin.php +++ b/src/FilamentDeveloperLoginsPlugin.php @@ -7,8 +7,8 @@ use DutchCodingCompany\FilamentDeveloperLogins\Exceptions\ImplementationException; use Filament\Contracts\Plugin; use Filament\Facades\Filament; -use Filament\Forms\Concerns\HasColumns; use Filament\Panel; +use Filament\Schemas\Concerns\HasColumns; use Filament\Support\Concerns\EvaluatesClosures; class FilamentDeveloperLoginsPlugin implements Plugin diff --git a/tests/TestCase.php b/tests/TestCase.php index c4f3004..9896a14 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,8 @@ namespace DutchCodingCompany\FilamentDeveloperLogins\Tests; +use BladeUI\Heroicons\BladeHeroiconsServiceProvider; +use BladeUI\Icons\BladeIconsServiceProvider; use DutchCodingCompany\FilamentDeveloperLogins\FilamentDeveloperLoginsPlugin; use DutchCodingCompany\FilamentDeveloperLogins\FilamentDeveloperLoginsServiceProvider; use DutchCodingCompany\FilamentDeveloperLogins\Http\Controllers\DeveloperLoginsController; @@ -13,6 +15,7 @@ use Filament\Notifications\NotificationsServiceProvider; use Filament\Pages\Dashboard; use Filament\Panel; +use Filament\Schemas\SchemasServiceProvider; use Filament\Support\SupportServiceProvider; use Filament\Widgets\WidgetsServiceProvider; use Illuminate\Database\Eloquent\Factories\Factory; @@ -29,6 +32,8 @@ protected function setUp(): void { parent::setUp(); + Filament::setCurrentPanel($this->panelName); + Factory::guessFactoryNamesUsing( fn ( string $modelName, @@ -104,6 +109,9 @@ protected function getPackageProviders($app): array NotificationsServiceProvider::class, FilamentDeveloperLoginsServiceProvider::class, LivewireServiceProvider::class, + BladeIconsServiceProvider::class, + BladeHeroiconsServiceProvider::class, + SchemasServiceProvider::class, ]; } }