Completed
Push — master ( 6ee53d...bb5f21 )
by ARCANEDEV
04:30
created

PermissionsTableSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 9.4285
ccs 0
cts 15
cp 0
cc 1
eloc 8
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Pages\Seeds;
2
3
use Arcanesoft\Auth\Seeds\PermissionsSeeder;
4
5
/**
6
 * Class     PermissionsTableSeeder
7
 *
8
 * @package  Arcanesoft\Pages\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'        => 'Pages',
26
                    'slug'        => 'page',
27
                    'description' => 'Pages permissions group',
28
                ],
29
                'permissions' => array_merge(
30
                    $this->getPagesSeeds()
31
                ),
32
            ],
33
        ]);
34
    }
35
36
    /* ------------------------------------------------------------------------------------------------
37
     |  Other Functions
38
     | ------------------------------------------------------------------------------------------------
39
     */
40
    /**
41
     * Get the Pages permissions.
42
     *
43
     * @return array
44
     */
45
    private function getPagesSeeds()
46
    {
47
        return [
48
            [
49
                'name'        => 'Pages - List all pages',
50
                'description' => 'Allow to list all pages.',
51
                'slug'        => 'pages.pages.list',
52
            ],[
53
                'name'        => 'Pages - View a page',
54
                'description' => 'Allow to display a page.',
55
                'slug'        => 'pages.pages.show',
56
            ],[
57
                'name'        => 'Pages - Create a page',
58
                'description' => 'Allow to create a page.',
59
                'slug'        => 'pages.pages.create',
60
            ],[
61
                'name'        => 'Pages - Update a page',
62
                'description' => 'Allow to update a page.',
63
                'slug'        => 'pages.pages.update',
64
            ],[
65
                'name'        => 'Pages - Delete a page',
66
                'description' => 'Allow to delete a page.',
67
                'slug'        => 'pages.pages.delete',
68
            ]
69
        ];
70
    }
71
}
72