From 5ae6451f7fefd341dd9fded2514117252f56e7f6 Mon Sep 17 00:00:00 2001 From: francoism90 Date: Tue, 23 Apr 2024 14:08:08 +0200 Subject: [PATCH] wip --- resources/views/navigation/group.blade.php | 2 ++ src/Navigation/Components/Group.php | 4 ++-- src/Navigation/Concerns/WithNavigation.php | 15 ++++++++++++--- src/Navigation/Contracts/HasNavigation.php | 4 ++-- src/Navigation/Support/Navigation.php | 10 ++++++++++ src/Navigation/Support/NavigationGroup.php | 10 ---------- src/Support/Components/Component.php | 13 ++++++++++++- 7 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 src/Navigation/Support/Navigation.php delete mode 100644 src/Navigation/Support/NavigationGroup.php diff --git a/resources/views/navigation/group.blade.php b/resources/views/navigation/group.blade.php index 42924a32..fc35efbd 100644 --- a/resources/views/navigation/group.blade.php +++ b/resources/views/navigation/group.blade.php @@ -11,6 +11,8 @@ ->whereDoesntStartWith('wire:model') }}> @foreach ($navigation->items() as $item) + {{ $item->state() }} + navigation->fill([ + 'schema' => $this->navigation(), + ]); + } + + public function navigation(): array { - return NavigationGroup::make(); + return []; } } diff --git a/src/Navigation/Contracts/HasNavigation.php b/src/Navigation/Contracts/HasNavigation.php index 5eae0a9e..174b36ab 100644 --- a/src/Navigation/Contracts/HasNavigation.php +++ b/src/Navigation/Contracts/HasNavigation.php @@ -2,9 +2,9 @@ namespace Foxws\WireUse\Navigation\Contracts; -use Foxws\WireUse\Navigation\Support\NavigationGroup; +use Foxws\WireUse\Navigation\Support\Navigation; interface HasNavigation { - public function navigation(): NavigationGroup; + // public function navigation(): array; } diff --git a/src/Navigation/Support/Navigation.php b/src/Navigation/Support/Navigation.php new file mode 100644 index 00000000..893b948d --- /dev/null +++ b/src/Navigation/Support/Navigation.php @@ -0,0 +1,10 @@ +toArray(); + } + + public static function fromLivewire($value): static + { + return new static($value); + } }