PermissionsTableSeeder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 62
ccs 0
cts 40
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 15 1
B getStatusesPermissions() 0 25 1
1
<?php namespace Arcanesoft\Backups\Seeds;
2
3
use Arcanesoft\Auth\Seeds\PermissionsSeeder;
4
use Arcanesoft\Backups\Policies\StatusesPolicy;
5
6
/**
7
 * Class     PermissionsTableSeeder
8
 *
9
 * @package  Arcanesoft\Backups\Seeds
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class PermissionsTableSeeder extends PermissionsSeeder
13
{
14
    /* -----------------------------------------------------------------
15
     |  Main Methods
16
     | -----------------------------------------------------------------
17
     */
18
19
    /**
20
     * Run the database seeds.
21
     */
22
    public function run()
23
    {
24
        $this->seed([
25
            [
26
                'group'       => [
27
                    'name'        => 'Backups',
28
                    'slug'        => 'backups',
29
                    'description' => 'backups permissions group',
30
                ],
31
                'permissions' => array_merge(
32
                    $this->getStatusesPermissions()
33
                ),
34
            ],
35
        ]);
36
    }
37
38
    /* -----------------------------------------------------------------
39
     |  Other Methods
40
     | -----------------------------------------------------------------
41
     */
42
43
    /**
44
     * Get the Statuses permissions.
45
     *
46
     * @return array
47
     */
48
    private function getStatusesPermissions()
49
    {
50
        return [
51
            [
52
                'name'        => 'Statuses - List all backups',
53
                'description' => 'Allow to list all posts.',
54
                'slug'        => StatusesPolicy::PERMISSION_LIST,
55
            ],
56
            [
57
                'name'        => 'Statuses - View a backup',
58
                'description' => 'Allow to display a post.',
59
                'slug'        => StatusesPolicy::PERMISSION_SHOW,
60
            ],
61
            [
62
                'name'        => 'Statuses - Create a backup',
63
                'description' => 'Allow to create a post.',
64
                'slug'        => StatusesPolicy::PERMISSION_CREATE,
65
            ],
66
            [
67
                'name'        => 'Statuses - Delete a backup',
68
                'description' => 'Allow to delete a post.',
69
                'slug'        => StatusesPolicy::PERMISSION_DELETE,
70
            ],
71
        ];
72
    }
73
}
74