Skip to content

Commit f1a4ad9

Browse files
committed
wip
1 parent 3fb68d5 commit f1a4ad9

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

config/filament-webhooks.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use Basement\Webhooks\Models\InboundWebhook;
4+
use Filament\Support\Icons\Heroicon;
5+
6+
return [
7+
'navigation_group' => 'Logs',
8+
'navigation_label' => 'Webhooks',
9+
'navigation_icon_inactive' => Heroicon::OutlinedBell,
10+
'navigation_icon_active' => Heroicon::Bell,
11+
'navigation_sort' => 100,
12+
13+
'model' => InboundWebhook::class,
14+
];

src/Filament/Admin/Resources/InboundWebhook/InboundWebhookResource.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,53 @@
88
use Basement\Webhooks\Models\InboundWebhook;
99
use Filament\Resources\Resource;
1010
use Filament\Support\Icons\Heroicon;
11+
use Illuminate\Contracts\Support\Htmlable;
1112
use Illuminate\Database\Eloquent\Builder;
1213
use Illuminate\Database\Eloquent\SoftDeletingScope;
14+
use UnitEnum;
1315

1416
class InboundWebhookResource extends Resource
1517
{
1618
protected static ?string $model = InboundWebhook::class;
1719

1820
protected static ?string $slug = 'inbound-webhooks';
1921

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+
2158

2259
public static function getPages(): array
2360
{

src/WebhooksServiceProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ protected function getPackageProviders($app)
3030

3131
public function configurePackage(Package $package): void
3232
{
33-
/*
34-
* This class is a Package Service Provider
35-
*
36-
* More info: https://github.com/spatie/laravel-package-tools
37-
*/
3833
$package
3934
->name('filament-webhooks')
35+
->hasConfigFile()
4036
->discoversMigrations();
4137
}
4238
}

0 commit comments

Comments
 (0)