@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function handle() |
28 | 28 | { |
29 | 29 | |
30 | - $nodes = [ |
|
30 | + $nodes = [ |
|
31 | 31 | 'name' => 'admin-menu', |
32 | 32 | 'title' => 'Administrator Menu', |
33 | 33 | 'description' => 'A default menu you can use for back office purposes', |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | 'is_active' => 1, |
37 | 37 | 'is_protected' => 1, |
38 | 38 | 'children' => [ |
39 | - [ |
|
39 | + [ |
|
40 | 40 | 'name' => 'dashboard', |
41 | 41 | 'permission' => 'backend', |
42 | 42 | 'title' => 'Dashboard', |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | 'icon' => 'fa fa-dashboard', |
46 | 46 | 'is_active' => 1, |
47 | 47 | 'is_protected' => 1, |
48 | - ], |
|
49 | - [ |
|
48 | + ], |
|
49 | + [ |
|
50 | 50 | 'name' => 'auth', |
51 | 51 | 'title' => 'Authorization', |
52 | 52 | 'description' => 'Manage Users, Roles and Permissions', |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'icon' => 'fa fa-key', |
55 | 55 | 'is_active' => 1, |
56 | 56 | 'children' => [ |
57 | - [ |
|
57 | + [ |
|
58 | 58 | 'name' => 'users', |
59 | 59 | 'permission' => 'administration', |
60 | 60 | 'title' => 'Users', |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | 'route' => config('back-project.route_prefix').'/users', |
63 | 63 | 'icon' => 'fa fa-users', |
64 | 64 | 'is_active' => 1 |
65 | - ], |
|
66 | - [ |
|
65 | + ], |
|
66 | + [ |
|
67 | 67 | 'name' => 'roles', |
68 | 68 | 'permission' => 'administration', |
69 | 69 | 'title' => 'Roles', |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | 'route' => config('back-project.route_prefix').'/roles', |
72 | 72 | 'icon' => 'fa fa-group', |
73 | 73 | 'is_active' => 1 |
74 | - ], |
|
75 | - [ |
|
74 | + ], |
|
75 | + [ |
|
76 | 76 | 'name' => 'permissions', |
77 | 77 | 'permission' => 'administration', |
78 | 78 | 'title' => 'Permissions', |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | 'route' => config('back-project.route_prefix').'/permissions', |
81 | 81 | 'icon' => 'fa fa-group', |
82 | 82 | 'is_active' => 1 |
83 | - ] |
|
83 | + ] |
|
84 | 84 | ] |
85 | - ], |
|
86 | - [ |
|
85 | + ], |
|
86 | + [ |
|
87 | 87 | 'name' => 'menus', |
88 | 88 | 'permission' => 'administration', |
89 | 89 | 'title' => 'Menus', |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | 'icon' => 'fa fa-ellipsis-v', |
93 | 93 | 'is_active' => 1, |
94 | 94 | 'is_protected' => 1, |
95 | - ], |
|
96 | - [ |
|
95 | + ], |
|
96 | + [ |
|
97 | 97 | 'name' => 'attachments', |
98 | 98 | 'permission' => 'backend', |
99 | 99 | 'title' => 'My Media', |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | 'icon' => 'fa fa-user-circle-o', |
103 | 103 | 'is_active' => 1, |
104 | 104 | 'is_protected' => 1, |
105 | - ], |
|
106 | - [ |
|
105 | + ], |
|
106 | + [ |
|
107 | 107 | 'name' => 'admin-attachments', |
108 | 108 | 'permission' => 'administration', |
109 | 109 | 'title' => 'All Media', |
@@ -112,36 +112,36 @@ discard block |
||
112 | 112 | 'icon' => 'fa fa-file-image-o', |
113 | 113 | 'is_active' => 1, |
114 | 114 | 'is_protected' => 1, |
115 | - ], |
|
115 | + ], |
|
116 | 116 | ] |
117 | - ]; |
|
117 | + ]; |
|
118 | 118 | |
119 | - // Truncate menu table |
|
120 | - DB::table('menus')->truncate(); |
|
119 | + // Truncate menu table |
|
120 | + DB::table('menus')->truncate(); |
|
121 | 121 | |
122 | - Menu::create($nodes); |
|
122 | + Menu::create($nodes); |
|
123 | 123 | |
124 | - $menus = DB::table('menus')->select('permission')->where('permission', '<>', '')->groupBy('permission')->get(); |
|
124 | + $menus = DB::table('menus')->select('permission')->where('permission', '<>', '')->groupBy('permission')->get(); |
|
125 | 125 | |
126 | - $role = Role::where('name', '=', 'administrator')->first(); |
|
127 | - $user_role = Role::where('name', '=', 'user')->first(); |
|
126 | + $role = Role::where('name', '=', 'administrator')->first(); |
|
127 | + $user_role = Role::where('name', '=', 'user')->first(); |
|
128 | 128 | |
129 | - foreach ($menus as $menu): |
|
129 | + foreach ($menus as $menu): |
|
130 | 130 | |
131 | 131 | if (!empty($menu->permission)) { |
132 | - $permission = Permission::firstOrCreate(['name' => $menu->permission]); |
|
132 | + $permission = Permission::firstOrCreate(['name' => $menu->permission]); |
|
133 | 133 | |
134 | - if (!$role->hasPermissionTo($menu->permission)) { |
|
134 | + if (!$role->hasPermissionTo($menu->permission)) { |
|
135 | 135 | |
136 | - $role->givePermissionTo($menu->permission); |
|
137 | - } |
|
136 | + $role->givePermissionTo($menu->permission); |
|
137 | + } |
|
138 | 138 | |
139 | - if ($menu->permission == 'backend' and !$role->hasPermissionTo($menu->permission)) { |
|
140 | - $user_role->givePermissionTo($menu->permission); |
|
141 | - } |
|
142 | - } |
|
143 | - endforeach; |
|
139 | + if ($menu->permission == 'backend' and !$role->hasPermissionTo($menu->permission)) { |
|
140 | + $user_role->givePermissionTo($menu->permission); |
|
141 | + } |
|
142 | + } |
|
143 | + endforeach; |
|
144 | 144 | |
145 | - $this->info('Seeding admin-menu'.'...'); |
|
145 | + $this->info('Seeding admin-menu'.'...'); |
|
146 | 146 | } |
147 | 147 | } |
@@ -31,12 +31,12 @@ |
||
31 | 31 | */ |
32 | 32 | public function handle(UserRegistered $event) |
33 | 33 | { |
34 | - //try { |
|
34 | + //try { |
|
35 | 35 | $user = $this->users->findBy('id', $event->user_id); |
36 | 36 | $user->notify(new RegistrationEmail($user)); |
37 | - //} catch(\Exception $e) { |
|
37 | + //} catch(\Exception $e) { |
|
38 | 38 | //Log::error('lavoro fallito'); |
39 | - //} |
|
39 | + //} |
|
40 | 40 | |
41 | 41 | } |
42 | 42 |
@@ -32,12 +32,12 @@ |
||
32 | 32 | */ |
33 | 33 | public function handle(UserRegistered $event) |
34 | 34 | { |
35 | - //try { |
|
35 | + //try { |
|
36 | 36 | $user = $this->users->findBy('id', $event->user_id); |
37 | 37 | $user->notify(new RegistrationEmail($user)); |
38 | - //} catch(\Exception $e) { |
|
38 | + //} catch(\Exception $e) { |
|
39 | 39 | //Log::error('lavoro fallito'); |
40 | - //} |
|
40 | + //} |
|
41 | 41 | |
42 | 42 | } |
43 | 43 |
@@ -1,23 +1,23 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'route_prefix' => 'admin', |
|
4 | - 'registration_open' => true, |
|
5 | - 'redirect_after_social_login' => 'admin.dashboard', // where to redirect after successfull login |
|
6 | - 'social_login_enabled' => [ |
|
7 | - 'facebook' => false, // enable facebook login |
|
8 | - 'twitter' => false, // enable twitter login |
|
9 | - 'linkedin' => false // enable linkedin login |
|
10 | - ], |
|
11 | - 'use_queue' => false, |
|
12 | - 'user_model' => Afrittella\BackProject\Models\Auth\User::class, |
|
13 | - // Menu logos |
|
14 | - 'logo_large' => '<b>Back</b>project', |
|
15 | - 'logo_small' => '<b>B</b>p', |
|
16 | - 'menus' => [ |
|
3 | + 'route_prefix' => 'admin', |
|
4 | + 'registration_open' => true, |
|
5 | + 'redirect_after_social_login' => 'admin.dashboard', // where to redirect after successfull login |
|
6 | + 'social_login_enabled' => [ |
|
7 | + 'facebook' => false, // enable facebook login |
|
8 | + 'twitter' => false, // enable twitter login |
|
9 | + 'linkedin' => false // enable linkedin login |
|
10 | + ], |
|
11 | + 'use_queue' => false, |
|
12 | + 'user_model' => Afrittella\BackProject\Models\Auth\User::class, |
|
13 | + // Menu logos |
|
14 | + 'logo_large' => '<b>Back</b>project', |
|
15 | + 'logo_small' => '<b>B</b>p', |
|
16 | + 'menus' => [ |
|
17 | 17 | 'table' => 'menus' |
18 | - ], |
|
19 | - 'attachments' => [ |
|
20 | - 'table' => 'attachments', |
|
21 | - 'max_file_size' => '2' // in Mb |
|
22 | - ] |
|
18 | + ], |
|
19 | + 'attachments' => [ |
|
20 | + 'table' => 'attachments', |
|
21 | + 'max_file_size' => '2' // in Mb |
|
22 | + ] |
|
23 | 23 | ]; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'Dashboard' => 'Bacheca', |
|
4 | - 'Authorization' => 'Autorizzazioni', |
|
5 | - 'Users' => 'Utenti', |
|
6 | - 'Roles' => 'Ruoli', |
|
7 | - 'Permissions' => 'Permessi', |
|
8 | - 'Menus' => 'Menu', |
|
9 | - 'My Media' => 'Le mie immagini', |
|
10 | - 'All Media' => 'Tutte le immagini' |
|
3 | + 'Dashboard' => 'Bacheca', |
|
4 | + 'Authorization' => 'Autorizzazioni', |
|
5 | + 'Users' => 'Utenti', |
|
6 | + 'Roles' => 'Ruoli', |
|
7 | + 'Permissions' => 'Permessi', |
|
8 | + 'Menus' => 'Menu', |
|
9 | + 'My Media' => 'Le mie immagini', |
|
10 | + 'All Media' => 'Tutte le immagini' |
|
11 | 11 | ]; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'Dashboard' => 'Dashboard', |
|
4 | - 'Authorization' => 'Authorization', |
|
5 | - 'Users' => 'Users', |
|
6 | - 'Roles' => 'Roles', |
|
7 | - 'Permissions' => 'Permissions', |
|
8 | - 'Menus' => 'Menus', |
|
9 | - 'My Media' => 'My Media', |
|
10 | - 'All Media' => 'All Media' |
|
3 | + 'Dashboard' => 'Dashboard', |
|
4 | + 'Authorization' => 'Authorization', |
|
5 | + 'Users' => 'Users', |
|
6 | + 'Roles' => 'Roles', |
|
7 | + 'Permissions' => 'Permissions', |
|
8 | + 'Menus' => 'Menus', |
|
9 | + 'My Media' => 'My Media', |
|
10 | + 'All Media' => 'All Media' |
|
11 | 11 | ]; |