fix(superadmin): stabilize knowledge base nav and docs grouping
This commit is contained in:
@@ -22,12 +22,14 @@ class SuperAdminKbPanelProvider extends PanelProvider
|
||||
{
|
||||
public function panel(Panel $panel): Panel
|
||||
{
|
||||
$knowledgeBasePath = $this->knowledgeBasePath();
|
||||
|
||||
return $panel
|
||||
->id('superadmin-kb')
|
||||
->path('super-admin/docs')
|
||||
->viteTheme('resources/css/filament/superadmin-kb/theme.css')
|
||||
->plugins([
|
||||
KnowledgeBasePlugin::make(base_path('docs/superadmin-kb')),
|
||||
KnowledgeBasePlugin::make($knowledgeBasePath),
|
||||
])
|
||||
->login(Login::class)
|
||||
->profile(EditProfile::class, isSimple: false)
|
||||
@@ -47,4 +49,11 @@ class SuperAdminKbPanelProvider extends PanelProvider
|
||||
])
|
||||
->authGuard('super_admin');
|
||||
}
|
||||
|
||||
protected function knowledgeBasePath(): string
|
||||
{
|
||||
$path = realpath(base_path('docs/superadmin-kb')) ?: base_path('docs/superadmin-kb');
|
||||
|
||||
return str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user