Skip to content

Commit

Permalink
Merge pull request #15 from aahelali/master
Browse files Browse the repository at this point in the history
HotFix create permission on PermissionsGenerate command
  • Loading branch information
amiryousefi committed Nov 29, 2021
2 parents a8dfd89 + 931edd5 commit e4cdc57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Commands/PermissionsGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ public function handle()
}

$name = $route->getName();
$permission = Permission::firstOrCreate(['action'=>$action, 'name'=>$name]);
$permission = Permission::updateOrCreate(
['name'=>$name],
['action'=>$action]
);

if (key_exists('role', $route->action)) {
$roles = $route->action['role'];
Expand Down

0 comments on commit e4cdc57

Please sign in to comment.