Skip to content

Commit

Permalink
Ability to control the ActivityResource navigation sort and if scope…
Browse files Browse the repository at this point in the history
…d 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
  • Loading branch information
silviugd authored Jan 8, 2025
1 parent 0c6c1d9 commit 78185b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/filament-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand Down
12 changes: 12 additions & 0 deletions src/Resources/ActivityResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


}

0 comments on commit 78185b9

Please sign in to comment.