Completed
Push — master ( e43e24...a5d827 )
by ARCANEDEV
05:31
created

PermissionTableSeeder::getUsersSeeds()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 26
ccs 0
cts 0
cp 0
rs 8.8571
cc 1
eloc 17
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Auth\Seeds\Foundation;
2
3
use Arcanesoft\Auth\Seeds\PermissionsSeeder;
4
5
/**
6
 * Class     PermissionTableSeeder
7
 *
8
 * @package  Arcanesoft\Auth\Seeds\Foundation
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class PermissionTableSeeder extends PermissionsSeeder
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Run the database seeds.
19
     */
20
    public function run()
21
    {
22
        $this->seed(array_merge(
23
            $this->getUsersSeeds(),
24
            $this->getRolesSeeds(),
25
            $this->getPermissionsSeeds()
26
        ));
27
    }
28
29
    /* ------------------------------------------------------------------------------------------------
30
     |  Other Functions
31
     | ------------------------------------------------------------------------------------------------
32
     */
33
    /**
34
     * Get user's permissions seeds.
35
     *
36
     * @return array
37
     */
38
    private function getUsersSeeds()
39
    {
40
        return [
41
            [
42
                'name'        => 'Auth - List all users',
43
                'description' => 'Allow to list all users.',
44
                'slug'        => 'auth.users.list',
45
            ],[
46
                'name'        => 'Auth - View a user',
47
                'description' => "Allow to view a user's details.",
48
                'slug'        => 'auth.users.show',
49
            ],[
50
                'name'        => 'Auth - Add/Create a user',
51
                'description' => 'Allow to create a new user.',
52
                'slug'        => 'auth.users.create',
53
            ],[
54
                'name'        => 'Auth - Edit/Update a user',
55
                'description' => 'Allow to update a user.',
56
                'slug'        => 'auth.users.update',
57
            ],[
58
                'name'        => 'Auth - Delete a user',
59
                'description' => 'Allow to delete a user.',
60
                'slug'        => 'auth.users.delete',
61
            ],
62
        ];
63
    }
64
65
    /**
66
     * Get role's permissions seeds.
67
     *
68
     * @return array
69
     */
70
    private function getRolesSeeds()
71
    {
72
        return [
73
            [
74
                'name'        => 'Auth - List all roles',
75
                'description' => 'Allow to list all roles.',
76
                'slug'        => 'auth.roles.list',
77
            ],[
78
                'name'        => 'Auth - View a role',
79
                'description' => "Allow to view the role's details.",
80
                'slug'        => 'auth.roles.show',
81
            ],[
82
                'name'        => 'Auth - Add/Create a role',
83
                'description' => 'Allow to create a new role.',
84
                'slug'        => 'auth.roles.create',
85
            ],[
86
                'name'        => 'Auth - Edit/Update a role',
87
                'description' => 'Allow to update a role.',
88
                'slug'        => 'auth.roles.update',
89
            ],[
90
                'name'        => 'Auth - Delete a role',
91
                'description' => 'Allow to delete a role.',
92
                'slug'        => 'auth.roles.delete',
93
            ],
94
        ];
95
    }
96
97
    /**
98
     * Get permissions's permissions seeds. (** Inception **)
99
     *
100
     * @return array
101
     */
102
    private function getPermissionsSeeds()
103
    {
104
        return [
105
            [
106
                'name'        => 'Auth - List all permissions',
107
                'description' => 'Allow to list all permissions.',
108
                'slug'        => 'auth.permissions.list',
109
            ],
110
        ];
111
    }
112
}
113