1: <?php namespace Laravella\Crud;
2:
3: use Laravella\Crud\Log;
4: use \Seeder;
5: use \DB;
6:
7: class extends CrudSeeder
8: {
9:
10: public function run()
11: {
12:
13: DB::table('_db_menus')->delete();
14: DB::table('_db_menu_permissions')->delete();
15:
16:
17: $topMenuId = $this->addMenu('TopMenu', '', 'icon-file', null);
18: DB::table('_db_menus')->where("id", $topMenuId)->update(array("parent_id"=>$topMenuId));
19:
20: $contentId = $this->addMenu('Contents', '', 'icon-file', $topMenuId);
21: $this->addMenu('Pages', '/db/select/contents', 'icon-file', $contentId);
22: $this->addMenu('Post Categories', '/db/select/categories', 'icon-file', $contentId);
23:
24: $this->addDivider($contentId);
25: $this->addMenu('Media', '/db/select/medias', 'icon-file', $contentId);
26: $this->addMenu('Collections', '/db/select/mcollections', 'icon-file', $contentId);
27: $this->addMenu('Galleries', '/db/select/galleries', 'icon-file', $contentId);
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39: $adminId = $this->addMenu('Admin', '/db', 'icon-file', $topMenuId);
40: $this->addMenu('Users', '/db/select/users', 'icon-file', $adminId);
41: $this->addMenu('Groups', '/db/select/usergroups', 'icon-file', $adminId);
42:
43:
44:
45: $this->addDivider($adminId);
46: $this->addMenu('Menus', '/db/select/_db_menus', 'icon-file', $adminId);
47: $this->addMenu('Menu Permissions', '/db/select/_db_menu_permissions', 'icon-file', $adminId);
48: $this->addMenu('divider', null, '', $adminId);
49: $this->addMenu('Options', '/db/select/_db_options', 'icon-file', $adminId);
50:
51: $metaDataId = $this->addMenu('Meta Data', '/db', 'icon-file', $topMenuId);
52: $this->addMenu('Home', '/', 'icon-file', $metaDataId);
53:
54: $this->addDivider($metaDataId);
55: $this->addMenu('Pages', '/db/select/_db_pages', 'icon-file', $metaDataId);
56: $this->addMenu('Tables', '/db/select/_db_tables', 'icon-file', $metaDataId);
57: $this->addMenu('Fields', '/db/select/_db_fields', 'icon-file', $metaDataId);
58: $this->addMenu('Keys', '/db/select/_db_key_fields', 'icon-file', $metaDataId);
59: $this->addMenu('Actions', '/db/select/_db_actions', 'icon-file', $metaDataId);
60: $this->addMenu('Views', '/db/select/_db_views', 'icon-file', $metaDataId);
61: $this->addDivider($metaDataId);
62: $this->addMenu('Key Types', '/db/select/_db_key_types', 'icon-file', $metaDataId);
63: $this->addMenu('Option Types', '/db/select/_db_option_types', 'icon-file', $metaDataId);
64: $this->addMenu('Display Types', '/db/select/_db_display_types', 'icon-file', $metaDataId);
65: $this->addMenu('Widget Types', '/db/select/_db_widget_types', 'icon-file', $metaDataId);
66: $this->addDivider($metaDataId);
67: $this->addMenu('Objects', '/db/select/_db_objects', 'icon-file', $metaDataId);
68: $this->addMenu('Assets', '/db/select/_db_assets', 'icon-file', $metaDataId);
69: $this->addMenu('Events', '/db/select/_db_events', 'icon-file', $metaDataId);
70: $this->addDivider($metaDataId);
71: $this->addMenu('Log', '/db/select/_db_log', 'icon-file', $metaDataId);
72: $this->addMenu('Audit', '/db/select/_db_audit', 'icon-file', $metaDataId);
73:
74: $this->addMenuPermissions($contentId, 'superadmin');
75: $this->addMenuPermissions($contentId, 'admin');
76:
77: $this->addMenuPermissions($metaDataId, 'superadmin');
78: $this->addMenuPermissions($metaDataId, 'admin');
79:
80: $this->addMenuPermissions($adminId, 'superadmin');
81: $this->addMenuPermissions($adminId, 'admin');
82:
83:
84: }
85: }
86: ?>