Skip to content

Commit e4cdc57

Browse files
authored
Merge pull request #15 from aahelali/master
HotFix create permission on PermissionsGenerate command
2 parents a8dfd89 + 931edd5 commit e4cdc57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Commands/PermissionsGenerate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public function handle()
5757
}
5858

5959
$name = $route->getName();
60-
$permission = Permission::firstOrCreate(['action'=>$action, 'name'=>$name]);
60+
$permission = Permission::updateOrCreate(
61+
['name'=>$name],
62+
['action'=>$action]
63+
);
6164

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

0 commit comments

Comments
 (0)