Skip to content

Commit 78185b9

Browse files
authored
Ability to control the ActivityResource navigation sort and if scoped to tenant (#117)
* feat: control over the ActivityResourse if scoped to tenant or not This commit adds a new configuration option `scoped_to_tenant` to the `filament-logger.php` file. The option is set to `true` (default in Filament). And a isScopedToTenant public static function in ActivityResource. * Ability to control the ActivityResource navigation sort and if scoped to tenant
1 parent 0c6c1d9 commit 78185b9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

config/filament-logger.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
'date_format' => 'd/m/Y',
55

66
'activity_resource' => \Z3d0X\FilamentLogger\Resources\ActivityResource::class,
7+
'scoped_to_tenant' => true,
8+
'navigation_sort' => null,
79

810
'resources' => [
911
'enabled' => true,
1012
'log_name' => 'Resource',
1113
'logger' => \Z3d0X\FilamentLogger\Loggers\ResourceLogger::class,
1214
'color' => 'success',
15+
1316
'exclude' => [
1417
//App\Filament\Resources\UserResource::class,
1518
],

src/Resources/ActivityResource.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,16 @@ public static function getNavigationIcon(): string
337337
{
338338
return __('filament-logger::filament-logger.nav.log.icon');
339339
}
340+
341+
public static function isScopedToTenant(): bool
342+
{
343+
return config('filament-logger.scoped_to_tenant', true);
344+
}
345+
346+
public static function getNavigationSort(): ?int
347+
{
348+
return config('filament-logger.navigation_sort', null);
349+
}
350+
351+
340352
}

0 commit comments

Comments
 (0)