Skip to content

Commit

Permalink
Update QuickCreatePlugin.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eneskomur authored Jul 17, 2024
1 parent 16ae178 commit 2e8fd9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/QuickCreatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public function getResources(): array
'model' => $resource->getModel(),
'icon' => $resource->getNavigationIcon(),
'action_name' => $actionName,
'action' => ! $resource->hasPage('create') || $this->shouldUseModal ? 'mountAction(\'' . $actionName . '\')' : null,
'url' => $resource->hasPage('create') && ! $this->shouldUseModal ? $resource::getUrl('create') : null,
'action' => ! $resource->hasPage('create') || $this->shouldUseModal() ? 'mountAction(\'' . $actionName . '\')' : null,
'url' => $resource->hasPage('create') && ! $this->shouldUseModal() ? $resource::getUrl('create') : null,
'navigation' => $resource->getNavigationSort(),
];
}
Expand Down Expand Up @@ -243,7 +243,7 @@ public function shouldUseModal(): bool
return $this->evaluate($this->shouldUseModal) ?? false;
}

public function alwaysShowModal(bool $condition = true): static
public function alwaysShowModal(bool | Closure $condition = true): static
{
$this->shouldUseModal = $condition;

Expand Down

0 comments on commit 2e8fd9b

Please sign in to comment.