Code Duplication    Length = 26-26 lines in 10 locations

src/Modules/Core/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Notifications/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Reporting/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Groups/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/OauthClients/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Permissions/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/PushNotificationDevices/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Users/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Core/Console/Commands/Stubs/Module/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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

src/Modules/Roles/Database/Seeds/AssignRelationsSeeder.php 1 location

@@ 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