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/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']) ?? []; }), 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