Skip to content

Commit

Permalink
Merge pull request #29 from Althinect/dev
Browse files Browse the repository at this point in the history
Fixed issue with caching
  • Loading branch information
tharindarodrigo authored Feb 28, 2023
2 parents d864921 + eaa0c0a commit 5ae23a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/filament-spatie-roles-permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
* $permission which is an iteration of [permission_affixes] ,
* $model The model to which the $permission will be concatenated
*
* Eg: 'permission_name' => fn($permissionAffix, $model) => $permissionAffix . ' ' . Str::kebab($model),
* Eg: 'permission_name' => 'return $permissionAffix . ' ' . Str::kebab($modelName),
*
* Note: If you are changing the "permission_name" , It's recommended to run with --clean to avoid duplications
*/
'permission_name' => fn($permissionAffix, $model) => $permissionAffix . ' ' . $model,
'permission_name' => 'return $permissionAffix . \' \' . $modelName;',

/*
* Permissions will be generated ONLY for the models associated with the respective Filament Resources
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function prepareClassPermissionsAndPolicies($classes): void
foreach ($this->permissionAffixes() as $key => $permissionAffix) {
foreach ($this->guardNames() as $guardName) {

$permission = call_user_func($this->config['permission_name'], $permissionAffix, $modelName);
$permission = eval($this->config['permission_name']);
$this->permissions[] = [
'name' => $permission,
'guard_name' => $guardName
Expand Down

0 comments on commit 5ae23a8

Please sign in to comment.