| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['setting'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['notification', 'pushNotificationDevice'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['report'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['group'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['permission'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['pushNotificationDevice'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 7-32 (lines=26) @@ | ||
| 4 | ||
| 5 | use Illuminate\Database\Seeder; |
|
| 6 | ||
| 7 | class AssignRelationsSeeder extends Seeder |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the database seeds. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function run() |
|
| 15 | { |
|
| 16 | $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * Assign the permissions to the admin group. |
|
| 20 | */ |
|
| 21 | \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['role'])->each(function ($permission) use ($adminGroupId) { |
|
| 22 | \DB::table('groups_permissions')->insert( |
|
| 23 | [ |
|
| 24 | 'permission_id' => $permission->id, |
|
| 25 | 'group_id' => $adminGroupId, |
|
| 26 | 'created_at' => \DB::raw('NOW()'), |
|
| 27 | 'updated_at' => \DB::raw('NOW()') |
|
| 28 | ] |
|
| 29 | ); |
|
| 30 | }); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||