From 26885dbe82de7688e01fb02f8473e8cc0dd1bd5e Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sun, 11 Aug 2024 07:36:09 +0300 Subject: [PATCH 1/2] fix add nav item --- .../Pages/Concerns/HandlesNavigationBuilder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php b/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php index 3c4ba4d..e89bd19 100644 --- a/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php +++ b/src/Filament/Resources/NavigationResource/Pages/Concerns/HandlesNavigationBuilder.php @@ -77,7 +77,11 @@ protected function getActions(): array Action::make('item') ->mountUsing(function (ComponentContainer $form) { if (! $this->mountedItem) { - return; + $form->fill([ + 'label' => '', + 'type' => 'external-link', + 'data' => [], + ]); } $form->fill($this->mountedItemData); @@ -114,6 +118,9 @@ protected function getActions(): array ->whenTruthy('type') ->schema(function (Get $get, Component $component) { $type = $get('type'); + if (! filled($type)) { + return []; + } return $component->evaluate(SkyPlugin::get()->getItemTypes()[$type]['fields']) ?? []; }), From 5f0daa65091d14c27fe04eb885f395f7098d0e53 Mon Sep 17 00:00:00 2001 From: atmonshi Date: Sun, 11 Aug 2024 04:36:30 +0000 Subject: [PATCH 2/2] Fix styling --- src/Configuration.php | 2 +- src/Models/PostScope.php | 1 - src/SkyPlugin.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Configuration.php b/src/Configuration.php index b89409d..dd77c03 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -87,7 +87,7 @@ public static function getModel(string $model): string { return array_merge( config('zeus-sky.models'), - (new static())::get()->getSkyModels() + (new static)::get()->getSkyModels() )[$model]; } diff --git a/src/Models/PostScope.php b/src/Models/PostScope.php index 8b6c552..8ce085a 100644 --- a/src/Models/PostScope.php +++ b/src/Models/PostScope.php @@ -65,7 +65,6 @@ public function scopePosts(Builder $query): Builder /** * @param Builder $query - * @param ?string $category */ public function scopeForCategory(Builder $query, ?string $category = null): Builder { diff --git a/src/SkyPlugin.php b/src/SkyPlugin.php index abffd63..d6b1cc5 100644 --- a/src/SkyPlugin.php +++ b/src/SkyPlugin.php @@ -51,7 +51,7 @@ public function register(Panel $panel): void public static function make(): static { - return new self(); + return new self; } public static function get(): static