Completed
Push — develop ( 508664...7b00fe )
by Abdelrahman
01:58
created

CortexAuthSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 63
Code Lines 51

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 63
rs 9.4347
c 0
b 0
f 0
cc 1
eloc 51
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
declare(strict_types=1);
4
5
use Illuminate\Database\Seeder;
6
7
class CortexAuthSeeder 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...
8
{
9
    /**
10
     * Run the database seeds.
11
     *
12
     * @return void
13
     */
14
    public function run()
15
    {
16
        Bouncer::allow('superadmin')->everything();
17
18
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.ability'));
19
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.ability'));
20
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.ability'));
21
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.ability'));
22
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.ability'));
23
        Bouncer::allow('admin')->to('grant', config('cortex.auth.models.ability'));
24
25
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.role'));
26
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.role'));
27
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.role'));
28
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.role'));
29
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.role'));
30
        Bouncer::allow('admin')->to('assign', config('cortex.auth.models.role'));
31
32
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.admin'));
33
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.admin'));
34
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.admin'));
35
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.admin'));
36
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.admin'));
37
38
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.member'));
39
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.member'));
40
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.member'));
41
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.member'));
42
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.member'));
43
44
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.manager'));
45
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.manager'));
46
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.manager'));
47
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.manager'));
48
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.manager'));
49
50
        Bouncer::allow('admin')->to('list', config('cortex.auth.models.guardian'));
51
        Bouncer::allow('admin')->to('create', config('cortex.auth.models.guardian'));
52
        Bouncer::allow('admin')->to('update', config('cortex.auth.models.guardian'));
53
        Bouncer::allow('admin')->to('delete', config('cortex.auth.models.guardian'));
54
        Bouncer::allow('admin')->to('audit', config('cortex.auth.models.guardian'));
55
56
        Bouncer::allow('owner')->to('list', config('cortex.auth.models.role'));
57
        Bouncer::allow('owner')->to('create', config('cortex.auth.models.role'));
58
        Bouncer::allow('owner')->to('update', config('cortex.auth.models.role'));
59
        Bouncer::allow('owner')->to('delete', config('cortex.auth.models.role'));
60
        Bouncer::allow('owner')->to('audit', config('cortex.auth.models.role'));
61
        Bouncer::allow('owner')->to('assign', config('cortex.auth.models.role'));
62
63
        Bouncer::allow('owner')->to('list', config('cortex.auth.models.member'));
64
        Bouncer::allow('owner')->to('create', config('cortex.auth.models.member'));
65
        Bouncer::allow('owner')->to('update', config('cortex.auth.models.member'));
66
        Bouncer::allow('owner')->to('delete', config('cortex.auth.models.member'));
67
        Bouncer::allow('owner')->to('audit', config('cortex.auth.models.member'));
68
69
        Bouncer::allow('owner')->to('list', config('cortex.auth.models.manager'));
70
        Bouncer::allow('owner')->to('create', config('cortex.auth.models.manager'));
71
        Bouncer::allow('owner')->to('update', config('cortex.auth.models.manager'));
72
        Bouncer::allow('owner')->to('delete', config('cortex.auth.models.manager'));
73
        Bouncer::allow('owner')->to('audit', config('cortex.auth.models.manager'));
74
75
        Bouncer::allow('owner')->to('grant', config('cortex.auth.models.ability'));
76
    }
77
}
78