From 78185b984920d04a06c730ade5c316411bd5c0f8 Mon Sep 17 00:00:00 2001 From: Silviu Dobre Date: Wed, 8 Jan 2025 05:28:13 +0200 Subject: [PATCH] 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 --- config/filament-logger.php | 3 +++ src/Resources/ActivityResource.php | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/config/filament-logger.php b/config/filament-logger.php index 4723020..5ce2697 100644 --- a/config/filament-logger.php +++ b/config/filament-logger.php @@ -4,12 +4,15 @@ 'date_format' => 'd/m/Y', 'activity_resource' => \Z3d0X\FilamentLogger\Resources\ActivityResource::class, + 'scoped_to_tenant' => true, + 'navigation_sort' => null, 'resources' => [ 'enabled' => true, 'log_name' => 'Resource', 'logger' => \Z3d0X\FilamentLogger\Loggers\ResourceLogger::class, 'color' => 'success', + 'exclude' => [ //App\Filament\Resources\UserResource::class, ], diff --git a/src/Resources/ActivityResource.php b/src/Resources/ActivityResource.php index b517409..299166d 100644 --- a/src/Resources/ActivityResource.php +++ b/src/Resources/ActivityResource.php @@ -337,4 +337,16 @@ public static function getNavigationIcon(): string { return __('filament-logger::filament-logger.nav.log.icon'); } + + public static function isScopedToTenant(): bool + { + return config('filament-logger.scoped_to_tenant', true); + } + + public static function getNavigationSort(): ?int + { + return config('filament-logger.navigation_sort', null); + } + + }