Skip to content

Commit

Permalink
Add ability to extend resources (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreia authored Mar 30, 2024
1 parent b55b2a4 commit b6e3882
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 6 additions & 1 deletion config/filament-spatie-roles-permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

return [

'resources' => [
'PermissionResource' => \Althinect\FilamentSpatieRolesPermissions\Resources\PermissionResource::class,
'RoleResource' => \Althinect\FilamentSpatieRolesPermissions\Resources\RoleResource::class,
],

'preload_roles' => true,

'preload_permissions' => true,

'navigation_section_group' => 'filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions', // Default uses language constant

'team_model' => \App\Models\Team::class,

'scope_to_tenant' => true,

/*
Expand Down
9 changes: 3 additions & 6 deletions src/FilamentSpatieRolesPermissionsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Althinect\FilamentSpatieRolesPermissions;

use Althinect\FilamentSpatieRolesPermissions\Resources\PermissionResource;
use Althinect\FilamentSpatieRolesPermissions\Resources\RoleResource;
use Filament\Contracts\Plugin;
use Filament\Panel;

Expand All @@ -17,10 +15,9 @@ public function getId(): string
public function register(Panel $panel): void
{
$panel
->resources([
RoleResource::class,
PermissionResource::class,
]);
->resources(
config('filament-spatie-roles-permissions.resources')
);
}

public static function make(): static
Expand Down

0 comments on commit b6e3882

Please sign in to comment.