From 0dee5f85770752b51e1f57df69bc50ec9cc72a89 Mon Sep 17 00:00:00 2001 From: Michael Lefrancois Date: Thu, 4 Mar 2021 10:27:04 +0100 Subject: [PATCH 1/2] added config option to show / hide default widgets --- config/filament.php | 1 + resources/views/dashboard.blade.php | 58 +++++++++++++++-------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/config/filament.php b/config/filament.php index 7b418299ea5..0bffe296cd2 100644 --- a/config/filament.php +++ b/config/filament.php @@ -84,6 +84,7 @@ 'widgets' => [ 'namespace' => 'App\\Filament\\Widgets', 'path' => app_path('Filament/Widgets'), + 'show_default' => True, ], /* diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index cbba1789d36..fc936e67fe2 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -6,40 +6,42 @@ aria-label="{{ __('filament::widgets.title') }}" class="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8" > - -
- + @if (config('filament.widgets.show_default')) + +
+ -
-

{{ __('filament::dashboard.widgets.account.heading', ['name' => Auth::guard('filament')->user()->name]) }}

-

{{ __('filament::dashboard.widgets.account.links.account.label') }}

+
+

{{ __('filament::dashboard.widgets.account.heading', ['name' => Auth::guard('filament')->user()->name]) }}

+

{{ __('filament::dashboard.widgets.account.links.account.label') }}

+
-
-
- - - + + @endif + @foreach (\Filament\Filament::getWidgets() as $widget) @livewire(\Livewire\Livewire::getAlias($widget)) @endforeach From 8eecea1027fda6c558128713506fa1e697761c77 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Thu, 4 Mar 2021 15:34:11 +0000 Subject: [PATCH 2/2] Change config properties --- config/filament.php | 11 +++++++---- resources/views/dashboard.blade.php | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/config/filament.php b/config/filament.php index 0bffe296cd2..728eb2ed75a 100644 --- a/config/filament.php +++ b/config/filament.php @@ -13,17 +13,17 @@ */ 'path' => 'admin', - + /* |-------------------------------------------------------------------------- | Filament Domain |-------------------------------------------------------------------------- | - | You may change the domain where Filament should be active. If the domain + | You may change the domain where Filament should be active. If the domain | is empty, all domains will be valid. | */ - + 'domain' => env('FILAMENT_DOMAIN', null), /* @@ -84,7 +84,10 @@ 'widgets' => [ 'namespace' => 'App\\Filament\\Widgets', 'path' => app_path('Filament/Widgets'), - 'show_default' => True, + 'default' => [ + 'account' => true, + 'info' => true, + ], ], /* diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index fc936e67fe2..b07c3575b16 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -6,7 +6,7 @@ aria-label="{{ __('filament::widgets.title') }}" class="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8" > - @if (config('filament.widgets.show_default')) + @if (config('filament.widgets.default.account', true))
@@ -17,7 +17,9 @@ class="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8"
+ @endif + @if (config('filament.widgets.default.info', true))
@@ -41,7 +43,7 @@ class="grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-8"
@endif - + @foreach (\Filament\Filament::getWidgets() as $widget) @livewire(\Livewire\Livewire::getAlias($widget)) @endforeach