diff --git a/src/Configuration.php b/src/Configuration.php index 615725c..0a20ce2 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -123,6 +123,8 @@ trait Configuration protected bool $hasLibraryResource = true; + protected bool $hasTagResource = true; + /* * @deprecated deprecated since version 3.2 */ @@ -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; diff --git a/src/SkyPlugin.php b/src/SkyPlugin.php index 7595e94..7763077 100644 --- a/src/SkyPlugin.php +++ b/src/SkyPlugin.php @@ -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