Skip to content

Commit 82552c9

Browse files
committed
Login on default panel
1 parent 63c26b4 commit 82552c9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/FlexibleContentBlockPagesPanel.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Statikbe\FilamentFlexibleContentBlockPages;
44

5+
use Filament\Facades\Filament;
56
use Filament\Panel;
67
use Filament\PanelProvider;
78
use Filament\SpatieLaravelTranslatablePlugin;
@@ -33,7 +34,8 @@ public static function configurePanel(Panel $panel, ?string $id = null): Panel
3334
->plugin(FlexibleContentBlockPagesPlugin::make())
3435
->plugin(SpatieLaravelTranslatablePlugin::make()
3536
->defaultLocales(FilamentFlexibleContentBlockPages::config()->getSupportedLocales()))
36-
->navigationItems(static::getExtraNavigationItems());
37+
->navigationItems(static::getExtraNavigationItems())
38+
->login(fn() => static::getLoginAction());
3739
}
3840

3941
/**
@@ -43,4 +45,15 @@ public static function getExtraNavigationItems(): array
4345
{
4446
return [];
4547
}
48+
49+
/**
50+
* Implements the login screen action that is used by this panel.
51+
* You can overwrite this in a subclass.
52+
* We assume in this default implementation that your app used multiple panels and
53+
* the default panel is used for authentication.
54+
*/
55+
public static function getLoginAction()
56+
{
57+
return redirect()->to(Filament::getDefaultPanel()->getLoginUrl());
58+
}
4659
}

0 commit comments

Comments
 (0)