Wrong usage for firstOrCreate method
This commit is contained in:
parent
7d9befedbf
commit
957898803f
@ -864,7 +864,8 @@ class Version200 extends Listener
|
|||||||
$moduleName = ucwords(str_replace("-", " ", $module));
|
$moduleName = ucwords(str_replace("-", " ", $module));
|
||||||
|
|
||||||
$permission = Permission::firstOrCreate([
|
$permission = Permission::firstOrCreate([
|
||||||
'name' => $permissionValue . '-' . $module,
|
'name' => $permissionValue . '-' . $module
|
||||||
|
], [
|
||||||
'display_name' => ucfirst($permissionValue) . ' ' . $moduleName,
|
'display_name' => ucfirst($permissionValue) . ' ' . $moduleName,
|
||||||
'description' => ucfirst($permissionValue) . ' ' . $moduleName,
|
'description' => ucfirst($permissionValue) . ' ' . $moduleName,
|
||||||
]);
|
]);
|
||||||
|
@ -183,7 +183,8 @@ class Roles extends Seeder
|
|||||||
$moduleName = ucwords(str_replace("-", " ", $module));
|
$moduleName = ucwords(str_replace("-", " ", $module));
|
||||||
|
|
||||||
$permission = Permission::firstOrCreate([
|
$permission = Permission::firstOrCreate([
|
||||||
'name' => $permissionValue . '-' . $module,
|
'name' => $permissionValue . '-' . $module
|
||||||
|
], [
|
||||||
'display_name' => ucfirst($permissionValue) . ' ' . $moduleName,
|
'display_name' => ucfirst($permissionValue) . ' ' . $moduleName,
|
||||||
'description' => ucfirst($permissionValue) . ' ' . $moduleName
|
'description' => ucfirst($permissionValue) . ' ' . $moduleName
|
||||||
]);
|
]);
|
||||||
|
@ -28,19 +28,22 @@ class InstallModule
|
|||||||
$permissions = [];
|
$permissions = [];
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'read-offline-payments-settings',
|
'name' => 'read-offline-payments-settings'
|
||||||
|
], [
|
||||||
'display_name' => 'Read Offline Payments Settings',
|
'display_name' => 'Read Offline Payments Settings',
|
||||||
'description' => 'Read Offline Payments Settings',
|
'description' => 'Read Offline Payments Settings',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'update-offline-payments-settings',
|
'name' => 'update-offline-payments-settings'
|
||||||
|
], [
|
||||||
'display_name' => 'Update Offline Payments Settings',
|
'display_name' => 'Update Offline Payments Settings',
|
||||||
'description' => 'Update Offline Payments Settings',
|
'description' => 'Update Offline Payments Settings',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'delete-offline-payments-settings',
|
'name' => 'delete-offline-payments-settings'
|
||||||
|
], [
|
||||||
'display_name' => 'Delete Offline Payments Settings',
|
'display_name' => 'Delete Offline Payments Settings',
|
||||||
'description' => 'Delete Offline Payments Settings',
|
'description' => 'Delete Offline Payments Settings',
|
||||||
]);
|
]);
|
||||||
|
@ -105,7 +105,8 @@ class InstallCommand extends Command
|
|||||||
$display_name = (new $class())->getDefaultName();
|
$display_name = (new $class())->getDefaultName();
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => $name,
|
'name' => $name
|
||||||
|
], [
|
||||||
'display_name' => 'Read ' . $module->getName() . ' Reports ' . $display_name,
|
'display_name' => 'Read ' . $module->getName() . ' Reports ' . $display_name,
|
||||||
'description' => 'Read ' . $module->getName() . ' Reports ' . $display_name,
|
'description' => 'Read ' . $module->getName() . ' Reports ' . $display_name,
|
||||||
]);
|
]);
|
||||||
@ -122,7 +123,8 @@ class InstallCommand extends Command
|
|||||||
$display_name = (new $class())->getDefaultName();
|
$display_name = (new $class())->getDefaultName();
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => $name,
|
'name' => $name
|
||||||
|
], [
|
||||||
'display_name' => 'Read ' . $module->getName() . ' Widgets ' . $display_name,
|
'display_name' => 'Read ' . $module->getName() . ' Widgets ' . $display_name,
|
||||||
'description' => 'Read ' . $module->getName() . ' Widgets ' . $display_name,
|
'description' => 'Read ' . $module->getName() . ' Widgets ' . $display_name,
|
||||||
]);
|
]);
|
||||||
@ -131,13 +133,15 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
if (!empty($module->get('settings'))) {
|
if (!empty($module->get('settings'))) {
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'read-' . $module->getAlias() . '-settings',
|
'name' => 'read-' . $module->getAlias() . '-settings'
|
||||||
|
], [
|
||||||
'display_name' => 'Read ' . $module->getName() . ' Settings',
|
'display_name' => 'Read ' . $module->getName() . ' Settings',
|
||||||
'description' => 'Read ' . $module->getName() . ' Settings',
|
'description' => 'Read ' . $module->getName() . ' Settings',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'update-' . $module->getAlias() . '-settings',
|
'name' => 'update-' . $module->getAlias() . '-settings'
|
||||||
|
], [
|
||||||
'display_name' => 'Update ' . $module->getName() . ' Settings',
|
'display_name' => 'Update ' . $module->getName() . ' Settings',
|
||||||
'description' => 'Update ' . $module->getName() . ' Settings',
|
'description' => 'Update ' . $module->getName() . ' Settings',
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user