@@ -91,7 +91,7 @@ |
||
91 | 91 | <a href="%s"><i class="%s text-red"></i><span>%s</span></a> |
92 | 92 | ' // url, icon, title |
93 | 93 | ]; |
94 | - $traverse = function ($rows) use (&$traverse, $templates, $user) { |
|
94 | + $traverse = function($rows) use (&$traverse, $templates, $user) { |
|
95 | 95 | $menuString = ""; |
96 | 96 | $hasActive = false; |
97 | 97 | foreach ($rows as $menu) { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | public function __construct(MenuRepository $menuRepository) |
14 | 14 | { |
15 | - $this->menuRepository = $menuRepository; |
|
15 | + $this->menuRepository = $menuRepository; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function compose(View $view) |
@@ -95,22 +95,22 @@ discard block |
||
95 | 95 | $menuString = ""; |
96 | 96 | $hasActive = false; |
97 | 97 | foreach ($rows as $menu) { |
98 | - if (!empty($menu->permission) and !$user->hasPermission($menu->permission)) { |
|
99 | - continue; |
|
100 | - } |
|
98 | + if (!empty($menu->permission) and !$user->hasPermission($menu->permission)) { |
|
99 | + continue; |
|
100 | + } |
|
101 | 101 | |
102 | - $hasActive = false; |
|
103 | - $link = sprintf($templates['menu_link'], |
|
102 | + $hasActive = false; |
|
103 | + $link = sprintf($templates['menu_link'], |
|
104 | 104 | (!empty($menu->route) ? url($menu->route) : '#'), |
105 | 105 | (!empty($menu->icon) ? $menu->icon : 'fa fa-circle-o'), |
106 | 106 | //trans('back-project::base.dashboard') |
107 | 107 | \Lang::has('back-project::menu.'.$menu->title) ? __('back-project::menu.'.$menu->title) : $menu->title |
108 | - ); |
|
108 | + ); |
|
109 | 109 | |
110 | - $submenu = ""; |
|
111 | - $authorized = true; |
|
110 | + $submenu = ""; |
|
111 | + $authorized = true; |
|
112 | 112 | |
113 | - if ($menu->children->count() > 0) { |
|
113 | + if ($menu->children->count() > 0) { |
|
114 | 114 | list($submenuString, $hasActive) = $traverse($menu->children); |
115 | 115 | $submenu = ""; |
116 | 116 | if (!empty($submenuString)) { |
@@ -118,19 +118,19 @@ discard block |
||
118 | 118 | } else { |
119 | 119 | $authorized = false; |
120 | 120 | } |
121 | - } |
|
121 | + } |
|
122 | 122 | |
123 | - $class = (!empty($submenu) ? 'treeview' : ''); |
|
124 | - $current_url = \Route::current()->uri(); |
|
123 | + $class = (!empty($submenu) ? 'treeview' : ''); |
|
124 | + $current_url = \Route::current()->uri(); |
|
125 | 125 | |
126 | - if ($authorized) { |
|
127 | - $menuString .= sprintf($templates['menu_row'], $class, $link.$submenu); |
|
128 | - } |
|
126 | + if ($authorized) { |
|
127 | + $menuString .= sprintf($templates['menu_row'], $class, $link.$submenu); |
|
128 | + } |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | return [ |
132 | - $menuString, |
|
133 | - $hasActive |
|
132 | + $menuString, |
|
133 | + $hasActive |
|
134 | 134 | ]; |
135 | 135 | }; |
136 | 136 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -Route::group(['namespace' => '\Afrittella\BackProject\Http\Controllers'], function () { |
|
3 | - Route::group(['middleware' => 'web'], function () { |
|
2 | +Route::group(['namespace' => '\Afrittella\BackProject\Http\Controllers'], function() { |
|
3 | + Route::group(['middleware' => 'web'], function() { |
|
4 | 4 | Route::get('confirm/{code}/{user}', 'Auth\RegisterController@confirm')->name('users.confirm'); |
5 | 5 | Route::auth(); |
6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | Route::get('auth/{provider}/callback', 'Auth\SocialLoginController@handleProviderCallback')->name('social_callback'); |
9 | 9 | }); |
10 | 10 | |
11 | - Route::group(['middleware' => 'web', 'prefix' => config('back-project.route_prefix')], function () { |
|
11 | + Route::group(['middleware' => 'web', 'prefix' => config('back-project.route_prefix')], function() { |
|
12 | 12 | Route::get('dashboard', 'AdminController@dashboard')->name('admin.dashboard'); |
13 | 13 | Route::get('account', 'UsersController@account')->name('admin.account'); |
14 | 14 | Route::put('account', 'UsersController@accountStore')->name('admin.add-account'); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | Route::get('attachments/{attachment}/main', 'AttachmentsController@setMain')->name('attachments.main'); |
19 | 19 | Route::resource('attachments', 'AttachmentsController', ['except' => ['destroy', 'show']]); |
20 | 20 | // Users |
21 | - Route::group(['middleware' => 'role:administrator'], function () { |
|
21 | + Route::group(['middleware' => 'role:administrator'], function() { |
|
22 | 22 | Route::get('users/{user}/delete', 'UsersController@delete')->name('users.delete'); // Implementing delete avoiding DELETE method |
23 | 23 | Route::resource('users', 'UsersController', ['except' => ['destroy', 'show']]); |
24 | 24 |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Afrittella\BackProject\Http\Controllers; |
4 | 4 | |
5 | -use Afrittella\BackProject\Exceptions\NotFoundException; |
|
6 | 5 | use Afrittella\BackProject\Http\Requests\AttachmentAdd; |
7 | 6 | use Afrittella\BackProject\Repositories\Attachments; |
8 | 7 | use Afrittella\BackProject\Repositories\Criteria\Attachments\ByUser; |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php namespace Afrittella\BackProject\Traits; |
2 | 2 | |
3 | 3 | use Afrittella\BackProject\Models\Attachment; |
4 | -use Illuminate\Support\Facades\Storage; |
|
5 | 4 | |
6 | 5 | trait Attachable |
7 | 6 | { |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | // - first the published views (in case they have any changes) |
34 | 34 | $this->loadViewsFrom(resource_path('views/vendor/back-project/base'), 'back-project'); |
35 | 35 | // - then the stock views that come with the package, in case a published view might be missing |
36 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'back-project'); |
|
36 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'back-project'); |
|
37 | 37 | // Load Translations |
38 | - $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'back-project'); |
|
38 | + $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'back-project'); |
|
39 | 39 | |
40 | 40 | // use the vendor configuration file as fallback |
41 | 41 | $this->mergeConfigFrom( |
42 | - __DIR__ . '/../config/config.php', 'back-project' |
|
42 | + __DIR__.'/../config/config.php', 'back-project' |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | $this->routes($router); |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | return new BackProject($app); |
64 | 64 | });*/ |
65 | 65 | |
66 | - $this->app->singleton('attachments-manager', function ($app) { |
|
66 | + $this->app->singleton('attachments-manager', function($app) { |
|
67 | 67 | return new MediaManager(); |
68 | 68 | }); |
69 | 69 | |
70 | - $this->app->singleton('back-project', function ($app) { |
|
70 | + $this->app->singleton('back-project', function($app) { |
|
71 | 71 | return new BackProject(); |
72 | 72 | }); |
73 | 73 | |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | public function publishFiles() |
105 | 105 | { |
106 | 106 | // publish config file |
107 | - $this->publishes([__DIR__ . '/../config/config.php' => config_path() . '/back-project.php'], 'config'); |
|
107 | + $this->publishes([__DIR__.'/../config/config.php' => config_path().'/back-project.php'], 'config'); |
|
108 | 108 | // publish lang files |
109 | - $this->publishes([__DIR__ . '/../resources/lang' => resource_path('lang/vendor/back-project')], 'lang'); |
|
109 | + $this->publishes([__DIR__.'/../resources/lang' => resource_path('lang/vendor/back-project')], 'lang'); |
|
110 | 110 | // publish public BackProject assets |
111 | - $this->publishes([__DIR__ . '/../public' => public_path('vendor/back-project')], 'public'); |
|
111 | + $this->publishes([__DIR__.'/../public' => public_path('vendor/back-project')], 'public'); |
|
112 | 112 | // publish views |
113 | - $this->publishes([__DIR__ . '/../resources/views' => resource_path('views/vendor/back-project')], 'views'); |
|
113 | + $this->publishes([__DIR__.'/../resources/views' => resource_path('views/vendor/back-project')], 'views'); |
|
114 | 114 | // publish error views |
115 | - $this->publishes([__DIR__ . '/../resources/error_views' => resource_path('views/errors')], 'errors'); |
|
115 | + $this->publishes([__DIR__.'/../resources/error_views' => resource_path('views/errors')], 'errors'); |
|
116 | 116 | // publish public AdminLTE assets |
117 | 117 | $this->publishes(['vendor/almasaeed2010/adminlte/bootstrap' => public_path('vendor/adminlte/bootstrap')], 'adminlte'); |
118 | 118 | $this->publishes(['vendor/almasaeed2010/adminlte/dist' => public_path('vendor/adminlte/dist')], 'adminlte'); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | //$router->aliasMiddleware('guest', \Afrittella\BackProject\Http\Middleware\RedirectIfAuthenticated::class); |
128 | 128 | $router->aliasMiddleware('role', \Afrittella\BackProject\Http\Middleware\Role::class); |
129 | 129 | |
130 | - $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); |
|
130 | + $this->loadRoutesFrom(__DIR__.'/../routes/web.php'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | public function handleMigrations() |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | $timestamp = date('Y_m_d_His', time()); |
138 | 138 | |
139 | 139 | $this->publishes([ |
140 | - __DIR__ . '/../database/migrations/' . $file . '.php' => |
|
141 | - database_path('migrations/' . $timestamp . '_' . $file . '.php') |
|
140 | + __DIR__.'/../database/migrations/'.$file.'.php' => |
|
141 | + database_path('migrations/'.$timestamp.'_'.$file.'.php') |
|
142 | 142 | ], 'migrations'); |
143 | 143 | } |
144 | 144 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function loadHelpers() |
179 | 179 | { |
180 | 180 | foreach ($this->helpers as $helper): |
181 | - $file = __DIR__ . '/Helpers/' . $helper . '.php'; |
|
181 | + $file = __DIR__.'/Helpers/'.$helper.'.php'; |
|
182 | 182 | |
183 | 183 | if (file_exists($file)) { |
184 | 184 | require_once($file); |