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
|
|
|
|