Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In the `users` method you can define the users (note: the users must exist), the
// ...
->plugins([
FilamentDeveloperLoginsPlugin::make()
->enabled()
->enabled(app()->environment('local'))
->users([
'Admin' => 'admin@example.com',
'User' => 'user@example.com',
Expand Down Expand Up @@ -65,7 +65,7 @@ Example:
```php
// ...
FilamentDeveloperLoginsPlugin::make()
->enabled(app()->environment('local'))
->enabled(fn() => app()->environment('local'))
```

### switchable()
Expand Down
2 changes: 1 addition & 1 deletion src/FilamentDeveloperLoginsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function getById(string $panelId): static
throw new ImplementationException('No panel found with filament-developer-logins plugin.');
}

public function enabled(Closure | bool $value = true): static
public function enabled(Closure | bool $value = false): static
{
$this->enabled = $value;

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/DeveloperLoginsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function test_an_exception_is_thrown_when_the_email_is_not_registered():
public function test_403_is_returned_when_plugin_is_disabled(): void
{
FilamentDeveloperLoginsPlugin::current()
->enabled(false);
->enabled();

$user = TestUser::factory()->create([
'email' => 'developer@dutchcodingcompany.com',
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function registerTestPanels(): void
])
->plugins([
FilamentDeveloperLoginsPlugin::make()
->enabled()
->enabled(true)
->users([
'Administrator' => 'developer@dutchcodingcompany.com',
])
Expand Down