Completed
Push — master ( 0dfd17...a38508 )
by Sherif
02:04
created

RolesTableSeeder::run()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 55

Duplication

Lines 55
Ratio 100 %

Importance

Changes 0
Metric Value
dl 55
loc 55
rs 8.9818
c 0
b 0
f 0
cc 1
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace App\Modules\Roles\Database\Seeds;
4
5
use Illuminate\Database\Seeder;
6
7 View Code Duplication
class RolesTableSeeder extends Seeder
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * Run the database seeds.
11
     *
12
     * @return void
13
     */
14
    public function run()
15
    {
16
        /**
17
         * Insert the permissions related to role table.
18
         */
19
        \DB::table('permissions')->insert(
20
            [
21
                /**
22
                 * role model permissions.
23
                 */
24
                [
25
                'name'       => 'index',
26
                'model'      => 'role',
27
                'created_at' => \DB::raw('NOW()'),
28
                'updated_at' => \DB::raw('NOW()')
29
                ],
30
                [
31
                'name'       => 'find',
32
                'model'      => 'role',
33
                'created_at' => \DB::raw('NOW()'),
34
                'updated_at' => \DB::raw('NOW()')
35
                ],
36
                [
37
                'name'       => 'insert',
38
                'model'      => 'role',
39
                'created_at' => \DB::raw('NOW()'),
40
                'updated_at' => \DB::raw('NOW()')
41
                ],
42
                [
43
                'name'       => 'update',
44
                'model'      => 'role',
45
                'created_at' => \DB::raw('NOW()'),
46
                'updated_at' => \DB::raw('NOW()')
47
                ],
48
                [
49
                'name'       => 'delete',
50
                'model'      => 'role',
51
                'created_at' => \DB::raw('NOW()'),
52
                'updated_at' => \DB::raw('NOW()')
53
                ],
54
                [
55
                'name'       => 'deleted',
56
                'model'      => 'role',
57
                'created_at' => \DB::raw('NOW()'),
58
                'updated_at' => \DB::raw('NOW()')
59
                ],
60
                [
61
                'name'       => 'restore',
62
                'model'      => 'role',
63
                'created_at' => \DB::raw('NOW()'),
64
                'updated_at' => \DB::raw('NOW()')
65
                ]
66
            ]
67
        );
68
    }
69
}
70