From 3e912fe8bc28f90431c85d086ac4a778f77d1d0f Mon Sep 17 00:00:00 2001 From: Sam Maosa Date: Mon, 31 Jul 2023 11:14:39 +0300 Subject: [PATCH 1/2] Updated the sidebar render hooks according to Filament's latest update of the hooks --- src/ModulesServiceProvider.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ModulesServiceProvider.php b/src/ModulesServiceProvider.php index 5357583b..bea3df30 100644 --- a/src/ModulesServiceProvider.php +++ b/src/ModulesServiceProvider.php @@ -39,13 +39,20 @@ public function register() $title = $id->replace(['::', '-'], [' ', ' '])->title()->toString(); $panel ->renderHook( - 'sidebar.start', + 'panels::sidebar.nav.start', fn() => new HtmlString("

$title

"), - )->renderHook( - 'sidebar.end', - fn() => new HtmlString("Go to Home"), ) - ; + ->renderHook( + 'panels::sidebar.nav.end', + fn() => new HtmlString( + ' + + + + Main Panel + ' + ), + ); } } }); From 78362f6e7b57ca05966c716b4e9a67bd8237a340 Mon Sep 17 00:00:00 2001 From: coolsam726 Date: Mon, 31 Jul 2023 08:15:43 +0000 Subject: [PATCH 2/2] Fix styling --- src/Modules.php | 2 -- src/ModulesServiceProvider.php | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Modules.php b/src/Modules.php index 7404fd47..b1d4d945 100755 --- a/src/Modules.php +++ b/src/Modules.php @@ -3,9 +3,7 @@ namespace Coolsam\FilamentModules; use Filament\Contracts\Plugin; -use Filament\Facades\Filament; use Filament\Panel; -use Illuminate\Support\HtmlString; class Modules implements Plugin { diff --git a/src/ModulesServiceProvider.php b/src/ModulesServiceProvider.php index bea3df30..0fb3a652 100644 --- a/src/ModulesServiceProvider.php +++ b/src/ModulesServiceProvider.php @@ -2,7 +2,6 @@ namespace Coolsam\FilamentModules; -use Closure; use Coolsam\FilamentModules\Commands\ModuleMakePanelCommand; use Coolsam\FilamentModules\Extensions\LaravelModulesServiceProvider; use Filament\Facades\Filament; @@ -40,12 +39,12 @@ public function register() $panel ->renderHook( 'panels::sidebar.nav.start', - fn() => new HtmlString("

$title

"), + fn () => new HtmlString("

$title

"), ) ->renderHook( 'panels::sidebar.nav.end', - fn() => new HtmlString( - ' + fn () => new HtmlString( + ' @@ -56,6 +55,7 @@ public function register() } } }); + return parent::register(); } }