From b8c2652bc815de79d32ecaad722d0c5b46e73205 Mon Sep 17 00:00:00 2001 From: Ryan Scherler Date: Wed, 4 Nov 2020 21:01:41 -0800 Subject: [PATCH] REfine model resources - use trait rather than contract --- config/filament.php | 3 ++- resources/views/components/nav.blade.php | 4 +-- resources/views/layouts/app.blade.php | 2 +- src/Contracts/FilamentResource.php | 7 ----- src/Filament.php | 7 ++--- src/FilamentServiceProvider.php | 1 + src/Traits/FilamentResource.php | 11 ++++++++ src/View/Components/Nav.php | 34 ++++++++++++++++++++++++ tests/TestCase.php | 1 + 9 files changed, 55 insertions(+), 15 deletions(-) delete mode 100644 src/Contracts/FilamentResource.php create mode 100644 src/Traits/FilamentResource.php create mode 100644 src/View/Components/Nav.php diff --git a/config/filament.php b/config/filament.php index 2029c6391c..33249597b4 100644 --- a/config/filament.php +++ b/config/filament.php @@ -84,6 +84,7 @@ return [ 'active' => 'filament.dashboard', // string or named route (may also be an array @link https://github.com/dwightwatson/active) 'label' => 'Dashboard', 'icon' => 'heroicon-o-home', // optional icon name (Blade UI Kit @link https://github.com/blade-ui-kit/blade-heroicons) + 'sort' => -1, // sort order used by the navigation ], ], @@ -99,7 +100,7 @@ return [ */ 'components' => [ - // 'alert' => Components\Alerts\Alert::class, + 'nav' => Filament\View\Components\Nav::class, ], /* diff --git a/resources/views/components/nav.blade.php b/resources/views/components/nav.blade.php index eaf4832b33..b6d196a259 100644 --- a/resources/views/components/nav.blade.php +++ b/resources/views/components/nav.blade.php @@ -1,8 +1,6 @@ -@inject('nav', 'Filament\Navigation') -