Completed
Push — master ( b25769...31f749 )
by ARCANEDEV
04:04
created

PermissionsTableSeeder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 78
ccs 0
cts 52
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 16 1
A getSettingsSeeds() 0 10 1
B getLogViewerSeeds() 0 26 1
1
<?php namespace Arcanesoft\Foundation\Seeds;
2
3
use Arcanesoft\Auth\Seeds\PermissionsSeeder;
4
5
/**
6
 * Class     PermissionTableSeeder
7
 *
8
 * @package  Arcanesoft\Foundation\Seeds
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class PermissionsTableSeeder extends PermissionsSeeder
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Run the database seeds.
19
     */
20
    public function run()
21
    {
22
        $this->seed([
23
            [
24
                'group'       => [
25
                    'name'        => 'Foundation',
26
                    'slug'        => 'foundation',
27
                    'description' => 'Foundation permissions group',
28
                ],
29
                'permissions' => array_merge(
30
                    $this->getSettingsSeeds(),
31
                    $this->getLogViewerSeeds()
32
                ),
33
            ],
34
        ]);
35
    }
36
37
    /* ------------------------------------------------------------------------------------------------
38
     |  Other Functions
39
     | ------------------------------------------------------------------------------------------------
40
     */
41
    /**
42
     * Get the Settings permissions.
43
     *
44
     * @return array
45
     */
46
    private function getSettingsSeeds()
47
    {
48
        return [
49
            [
50
                'name'        => 'Settings - View the general settings',
51
                'description' => 'Allow to view the general settings.',
52
                'slug'        => 'foundation.settings.general',
53
            ]
54
        ];
55
    }
56
57
    /**
58
     * Get the LogViewer permissions.
59
     *
60
     * @return array
61
     */
62
    private function getLogViewerSeeds()
63
    {
64
        return [
65
            [
66
                'name'        => 'LogViewer - View dashboard',
67
                'description' => 'Allow to view the LogViewer dashboard.',
68
                'slug'        => 'foundation.logviewer.dashboard',
69
            ],[
70
                'name'        => 'LogViewer - List all logs',
71
                'description' => 'Allow to list all the logs.',
72
                'slug'        => 'foundation.logviewer.list',
73
            ],[
74
                'name'        => 'LogViewer - View a log',
75
                'description' => 'Allow to display a log.',
76
                'slug'        => 'foundation.logviewer.show',
77
            ],[
78
                'name'        => 'LogViewer - Download a log',
79
                'description' => 'Allow to download a log.',
80
                'slug'        => 'foundation.logviewer.download',
81
            ],[
82
                'name'        => 'LogViewer - Delete a log',
83
                'description' => 'Allow to delete a log.',
84
                'slug'        => 'foundation.logviewer.delete',
85
            ]
86
        ];
87
    }
88
}
89