|
8 | 8 | use Basement\Webhooks\Models\InboundWebhook; |
9 | 9 | use Filament\Resources\Resource; |
10 | 10 | use Filament\Support\Icons\Heroicon; |
| 11 | +use Illuminate\Contracts\Support\Htmlable; |
11 | 12 | use Illuminate\Database\Eloquent\Builder; |
12 | 13 | use Illuminate\Database\Eloquent\SoftDeletingScope; |
| 14 | +use UnitEnum; |
13 | 15 |
|
14 | 16 | class InboundWebhookResource extends Resource |
15 | 17 | { |
16 | 18 | protected static ?string $model = InboundWebhook::class; |
17 | 19 |
|
18 | 20 | protected static ?string $slug = 'inbound-webhooks'; |
19 | 21 |
|
20 | | - protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack; |
| 22 | + /** |
| 23 | + * @return string|UnitEnum|null |
| 24 | + */ |
| 25 | + public static function getNavigationGroup(): UnitEnum|string|null |
| 26 | + { |
| 27 | + return config('filament-webhooks.navigation_group', 'Logs'); |
| 28 | + } |
| 29 | + |
| 30 | + public static function getNavigationLabel(): string |
| 31 | + { |
| 32 | + return config('filament-webhooks.navigation_label', 'Webhooks'); |
| 33 | + } |
| 34 | + |
| 35 | + /** |
| 36 | + * @return int|null |
| 37 | + */ |
| 38 | + public static function getNavigationSort(): ?int |
| 39 | + { |
| 40 | + return config('filament-webhooks.navigation_sort', 10); |
| 41 | + } |
| 42 | + |
| 43 | + public static function getModel(): string |
| 44 | + { |
| 45 | + return config('filament-webhooks.model', InboundWebhook::class); |
| 46 | + } |
| 47 | + |
| 48 | + public static function getNavigationIcon(): string|BackedEnum|Htmlable|null |
| 49 | + { |
| 50 | + return config('filament-webhooks.navigation_icon_inactive', Heroicon::DocumentText); |
| 51 | + } |
| 52 | + |
| 53 | + public static function getActiveNavigationIcon(): BackedEnum|string|null |
| 54 | + { |
| 55 | + return config('filament-webhooks.navigation_icon_active', Heroicon::Bell); |
| 56 | + } |
| 57 | + |
21 | 58 |
|
22 | 59 | public static function getPages(): array |
23 | 60 | { |
|
0 commit comments