Skip to content

Commit

Permalink
Merge pull request #170 from lara-zeus/has-tag-resource
Browse files Browse the repository at this point in the history
allow to hide tag resource
  • Loading branch information
atmonshi authored Oct 18, 2023
2 parents a34dad0 + 32973bb commit 49aa066
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ trait Configuration

protected bool $hasLibraryResource = true;

protected bool $hasTagResource = true;

/*
* @deprecated deprecated since version 3.2
*/
Expand Down Expand Up @@ -389,6 +391,18 @@ public function hasLibraryResource(): bool
return $this->hasLibraryResource;
}

public function tagResource(bool $condition = true): static
{
$this->hasTagResource = $condition;

return $this;
}

public function hasTagResource(): bool
{
return $this->hasTagResource;
}

public function libraryTypes(array $types): static
{
$this->libraryTypes = $types;
Expand Down
4 changes: 3 additions & 1 deletion src/SkyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public function register(Panel $panel): void
$panel->resources([LibraryResource::class]);
}

$panel->resources([TagResource::class]);
if ($this->hasTagResource()) {
$panel->resources([TagResource::class]);
}
}

public static function make(): static
Expand Down

0 comments on commit 49aa066

Please sign in to comment.