Skip to content

Commit

Permalink
Merge pull request #209 from lara-zeus/fix-nav
Browse files Browse the repository at this point in the history
Fix add nav item action
  • Loading branch information
atmonshi authored Aug 11, 2024
2 parents 422c486 + 5f0daa6 commit 594c7bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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']) ?? [];
}),
Expand Down
1 change: 0 additions & 1 deletion src/Models/PostScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function scopePosts(Builder $query): Builder

/**
* @param Builder<Post> $query
* @param ?string $category
*/
public function scopeForCategory(Builder $query, ?string $category = null): Builder
{
Expand Down
2 changes: 1 addition & 1 deletion src/SkyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 594c7bd

Please sign in to comment.