RoleSeeder::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 37
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 21
nc 2
nop 0
dl 0
loc 37
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
namespace Database\Seeders;
4
5
use Illuminate\Database\Seeder;
6
use Illuminate\Support\Facades\DB;
7
8
class RoleSeeder extends Seeder
9
{
10
    /**
11
     * Run the database seeds.
12
     *
13
     * @return void
14
     */
15
    public function run()
16
    {
17
        if (! config('adminetic.migrate_with_dummy', false)) {
18
            $roles = [
19
                [
20
                    'name' => 'superadmin',
21
                    'description' => 'This is a super admin user',
22
                    'level' => 5,
23
                ],
24
                [
25
                    'name' => 'admin',
26
                    'description' => 'This is an admin user',
27
                    'level' => 4,
28
                ],
29
                [
30
                    'name' => 'moderator',
31
                    'description' => 'This is an moderator',
32
                    'level' => 3,
33
                ],
34
                [
35
                    'name' => 'editor',
36
                    'description' => 'This is an editor',
37
                    'level' => 2,
38
                ],
39
                [
40
                    'name' => 'user',
41
                    'description' => 'This is an normal user',
42
                    'level' => 1,
43
                ],
44
                [
45
                    'name' => 'unverified',
46
                    'description' => 'This is an unverified user',
47
                    'level' => 0,
48
                ],
49
            ];
50
51
            DB::table('roles')->insert($roles);
52
        }
53
    }
54
}
55