Completed
Push — master ( 02d451...2ce496 )
by Sherif
02:39
created

GroupsTableSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 110
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 110
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B run() 0 102 1
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class GroupsTableSeeder extends Seeder
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    /**
8
     * Run the database seeds.
9
     *
10
     * @return void
11
     */
12
    public function run()
13
    {
14
    	/**
15
         * Insert the permissions related to groups table.
16
         */
17
        DB::table('permissions')->insert(
18
        	[
19
        		/**
20
        		 * Groups model permissions.
21
        		 */
22
	        	[
23
	        	'name'       => 'save',
24
	        	'model'      => 'groups',
25
	        	'created_at' => \DB::raw('NOW()'),
26
	        	'updated_at' => \DB::raw('NOW()')
27
	        	],
28
	        	[
29
	        	'name'       => 'delete',
30
	        	'model'      => 'groups',
31
	        	'created_at' => \DB::raw('NOW()'),
32
	        	'updated_at' => \DB::raw('NOW()')
33
	        	],
34
	        	[
35
	        	'name'       => 'find',
36
	        	'model'      => 'groups',
37
	        	'created_at' => \DB::raw('NOW()'),
38
	        	'updated_at' => \DB::raw('NOW()')
39
	        	],
40
	        	[
41
	        	'name'       => 'search',
42
	        	'model'      => 'groups',
43
	        	'created_at' => \DB::raw('NOW()'),
44
	        	'updated_at' => \DB::raw('NOW()')
45
	        	],
46
	        	[
47
	        	'name'       => 'list',
48
	        	'model'      => 'groups',
49
	        	'created_at' => \DB::raw('NOW()'),
50
	        	'updated_at' => \DB::raw('NOW()')
51
	        	],
52
	        	[
53
	        	'name'       => 'findby',
54
	        	'model'      => 'groups',
55
	        	'created_at' => \DB::raw('NOW()'),
56
	        	'updated_at' => \DB::raw('NOW()')
57
	        	],
58
	        	[
59
	        	'name'       => 'first',
60
	        	'model'      => 'groups',
61
	        	'created_at' => \DB::raw('NOW()'),
62
	        	'updated_at' => \DB::raw('NOW()')
63
	        	],
64
	        	[
65
	        	'name'       => 'paginate',
66
	        	'model'      => 'groups',
67
	        	'created_at' => \DB::raw('NOW()'),
68
	        	'updated_at' => \DB::raw('NOW()')
69
	        	],
70
	        	[
71
	        	'name'       => 'paginateby',
72
	        	'model'      => 'groups',
73
	        	'created_at' => \DB::raw('NOW()'),
74
	        	'updated_at' => \DB::raw('NOW()')
75
	        	],
76
	        	[
77
	        	'name'       => 'assignpermissions',
78
	        	'model'      => 'groups',
79
	        	'created_at' => \DB::raw('NOW()'),
80
	        	'updated_at' => \DB::raw('NOW()')
81
	        	],
82
	        	[
83
	        	'name'       => 'users',
84
	        	'model'      => 'groups',
85
	        	'created_at' => \DB::raw('NOW()'),
86
	        	'updated_at' => \DB::raw('NOW()')
87
	        	],
88
                [
89
                'name'       => 'deleted',
90
                'model'      => 'groups',
91
                'created_at' => \DB::raw('NOW()'),
92
                'updated_at' => \DB::raw('NOW()')
93
                ],
94
                [
95
                'name'       => 'restore',
96
                'model'      => 'groups',
97
                'created_at' => \DB::raw('NOW()'),
98
                'updated_at' => \DB::raw('NOW()')
99
                ]
100
        	]
101
        );
102
103
		/**
104
		 * Create Default groups.
105
		 */
106
		DB::table('groups')->insertGetId(
107
			[
108
			'name'       => 'Admin',
109
			'created_at' => \DB::raw('NOW()'),
110
			'updated_at' => \DB::raw('NOW()')
111
			]
112
		);
113
    }
114
}
115