Skip to content

Commit 7866282

Browse files
authored
Merge pull request #53 from thyseus/enabled-function
Make the enabled() function required
2 parents dbe7eec + 1e2ab92 commit 7866282

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In the `users` method you can define the users (note: the users must exist), the
3535
// ...
3636
->plugins([
3737
FilamentDeveloperLoginsPlugin::make()
38-
->enabled()
38+
->enabled(app()->environment('local'))
3939
->users([
4040
'Admin' => 'admin@example.com',
4141
'User' => 'user@example.com',
@@ -65,7 +65,7 @@ Example:
6565
```php
6666
// ...
6767
FilamentDeveloperLoginsPlugin::make()
68-
->enabled(app()->environment('local'))
68+
->enabled(fn() => app()->environment('local'))
6969
```
7070

7171
### switchable()

src/FilamentDeveloperLoginsPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function getById(string $panelId): static
8484
throw new ImplementationException('No panel found with filament-developer-logins plugin.');
8585
}
8686

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

tests/Feature/DeveloperLoginsControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function test_an_exception_is_thrown_when_the_email_is_not_registered():
5252
public function test_403_is_returned_when_plugin_is_disabled(): void
5353
{
5454
FilamentDeveloperLoginsPlugin::current()
55-
->enabled(false);
55+
->enabled();
5656

5757
$user = TestUser::factory()->create([
5858
'email' => 'developer@dutchcodingcompany.com',

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function registerTestPanels(): void
5555
])
5656
->plugins([
5757
FilamentDeveloperLoginsPlugin::make()
58-
->enabled()
58+
->enabled(true)
5959
->users([
6060
'Administrator' => 'developer@dutchcodingcompany.com',
6161
])

0 commit comments

Comments
 (0)