getId()); } // ─── Plugin interface ──────────────────────────────────────────────────── public function getId(): string { return 'filament-short-url'; } public function register(Panel $panel): void { $panel ->resources([ ShortUrlResource::class, ]); } public function boot(Panel $panel): void { // Configuration is consumed by ShortUrlResource via FilamentShortUrlPlugin::get() } // ─── Fluent configuration API ──────────────────────────────────────────── /** * Set the navigation group for the Short URLs resource. * * @example FilamentShortUrlPlugin::make()->navigationGroup('Marketing') */ public function navigationGroup(string $group): static { $this->navigationGroup = $group; return $this; } public function getNavigationGroup(): ?string { return $this->navigationGroup; } /** * Set the navigation sort order. * * @example FilamentShortUrlPlugin::make()->navigationSort(50) */ public function navigationSort(int $sort): static { $this->navigationSort = $sort; return $this; } public function getNavigationSort(): ?int { return $this->navigationSort; } /** * Override the navigation label (menu item name). * * @example FilamentShortUrlPlugin::make()->navigationLabel('Short Links') */ public function navigationLabel(string $label): static { $this->navigationLabel = $label; return $this; } public function getNavigationLabel(): ?string { return $this->navigationLabel; } /** * Override the navigation icon. * * @example FilamentShortUrlPlugin::make()->navigationIcon('heroicon-o-link') */ public function navigationIcon(string $icon): static { $this->navigationIcon = $icon; return $this; } public function getNavigationIcon(): ?string { return $this->navigationIcon; } /** * Set a custom callback to authorize access to the Short URL settings page. * * @example FilamentShortUrlPlugin::make()->authorizeSettingsUsing(fn () => auth()->user()->hasRole('admin')) */ public function authorizeSettingsUsing(\Closure $callback): static { $this->authorizeSettingsUsing = $callback; return $this; } public function getAuthorizeSettingsUsing(): ?\Closure { return $this->authorizeSettingsUsing; } }