Skip to content

Commit

Permalink
Add config to place resources inside clusters (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
markcameron authored Apr 8, 2024
1 parent 98edf4d commit e34ad95
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/filament-spatie-roles-permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
'roles' => true,
],

/*
* If you want to place the Resource in a Cluster, then set the required Cluster class.
* Eg. \App\Filament\Clusters\Cluster::class
*/
'clusters' => [
'permissions' => null,
'roles' => null,
],

'guard_names' => [
'web' => 'web',
'api' => 'api',
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/PermissionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public static function getPluralLabel(): string
return __('filament-spatie-roles-permissions::filament-spatie.section.permissions');
}

public static function getCluster(): ?string
{
return config('filament-spatie-roles-permissions.clusters.permissions', null);
}

public static function form(Form $form): Form
{
return $form
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public static function getPluralLabel(): string
return __('filament-spatie-roles-permissions::filament-spatie.section.roles');
}

public static function getCluster(): ?string
{
return config('filament-spatie-roles-permissions.clusters.roles', null);
}

public static function form(Form $form): Form
{
return $form
Expand Down

0 comments on commit e34ad95

Please sign in to comment.