Skip to content

Commit

Permalink
refactor routeNamePrefix to core trait
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Oct 2, 2024
1 parent 839d618 commit eeb633a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 47 deletions.
65 changes: 32 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ trait Configuration

protected array | Closure $extraFields = [];

protected Closure | string | null $routeNamePrefix = null;

public function navigationGroupLabel(Closure | string $lable): static
{
$this->navigationGroupLabel = $lable;
Expand Down Expand Up @@ -281,16 +279,4 @@ public function hideResources(array $resources = []): static

return $this;
}

public function routeNamePrefix(Closure | string | null $prefix): static
{
$this->routeNamePrefix = $prefix;

return $this;
}

public function getRouteNamePrefix(): Closure | string | null
{
return $this->evaluate($this->routeNamePrefix);
}
}
2 changes: 2 additions & 0 deletions src/SkyPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Filament\Contracts\Plugin;
use Filament\Panel;
use Filament\Support\Concerns\EvaluatesClosures;
use LaraZeus\Core\Concerns\HasRouteNamePrefix;
use LaraZeus\Sky\Filament\Resources\FaqResource;
use LaraZeus\Sky\Filament\Resources\LibraryResource;
use LaraZeus\Sky\Filament\Resources\NavigationResource;
Expand All @@ -16,6 +17,7 @@ final class SkyPlugin implements Plugin
{
use Configuration;
use EvaluatesClosures;
use HasRouteNamePrefix;

public function getId(): string
{
Expand Down

0 comments on commit eeb633a

Please sign in to comment.