@@ -31,8 +31,7 @@ |
||
| 31 | 31 | if($request->has('published')){ |
| 32 | 32 | |
| 33 | 33 | $request->merge(['published_at' => \Carbon\Carbon::now()]); |
| 34 | - } |
|
| 35 | - else{ |
|
| 34 | + } else{ |
|
| 36 | 35 | |
| 37 | 36 | $request->merge(['published_at' => NULL]); |
| 38 | 37 | } |
@@ -29,13 +29,13 @@ |
||
| 29 | 29 | public function handle(Request $request, Closure $next) |
| 30 | 30 | { |
| 31 | 31 | |
| 32 | - if($request->has('published')){ |
|
| 32 | + if ($request->has('published')) { |
|
| 33 | 33 | |
| 34 | - $request->merge(['published_at' => \Carbon\Carbon::now()]); |
|
| 34 | + $request->merge([ 'published_at' => \Carbon\Carbon::now() ]); |
|
| 35 | 35 | } |
| 36 | - else{ |
|
| 36 | + else { |
|
| 37 | 37 | |
| 38 | - $request->merge(['published_at' => NULL]); |
|
| 38 | + $request->merge([ 'published_at' => NULL ]); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | return $next($request); |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | * Get lookup table data and insert into request |
| 32 | 32 | */ |
| 33 | 33 | $intArgs = func_num_args(); |
| 34 | - for($a = 2; $a < $intArgs; $a++){ |
|
| 34 | + for ($a = 2; $a < $intArgs; $a++) { |
|
| 35 | 35 | |
| 36 | 36 | $model = func_get_arg($a); |
| 37 | - $modelWithNamespace = 'App\\'.$model; |
|
| 37 | + $modelWithNamespace = 'App\\' . $model; |
|
| 38 | 38 | |
| 39 | - $request->merge([$model => $modelWithNamespace::orderBy('name', 'asc')->get()]); |
|
| 39 | + $request->merge([ $model => $modelWithNamespace::orderBy('name', 'asc')->get() ]); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $next($request); |
@@ -153,8 +153,8 @@ |
||
| 153 | 153 | ]]); |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * Advertising |
|
| 157 | - */ |
|
| 156 | + * Advertising |
|
| 157 | + */ |
|
| 158 | 158 | Route::resource('advert', 'Admin\AdvertController', ['names' => [ |
| 159 | 159 | 'index' => 'advert.index', |
| 160 | 160 | 'create' => 'advert.create', |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Root |
| 17 | 17 | */ |
| 18 | -Route::get('/', ['as' => 'root', function () { |
|
| 18 | +Route::get('/', [ 'as' => 'root', function() { |
|
| 19 | 19 | return view('welcome'); |
| 20 | -}]); |
|
| 20 | +} ]); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Main index |
| 24 | 24 | */ |
| 25 | -Route::get('/home', function () { |
|
| 25 | +Route::get('/home', function() { |
|
| 26 | 26 | |
| 27 | 27 | return redirect()->route('admin.dashboard.index'); |
| 28 | 28 | }); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Admin |
| 32 | 32 | */ |
| 33 | -Route::group(['prefix' => env('APP_ADMIN_URL', 'admin'), 'as' => 'admin.', 'middleware' => ['web', 'auth']], function () { |
|
| 33 | +Route::group([ 'prefix' => env('APP_ADMIN_URL', 'admin'), 'as' => 'admin.', 'middleware' => [ 'web', 'auth' ] ], function() { |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Articles and categories |
| 45 | 45 | */ |
| 46 | - Route::resource('page', 'Admin\PageController', ['names' => [ |
|
| 46 | + Route::resource('page', 'Admin\PageController', [ 'names' => [ |
|
| 47 | 47 | 'index' => 'page.index', |
| 48 | 48 | 'create' => 'page.create', |
| 49 | 49 | 'store' => 'page.store', |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | 'edit' => 'page.edit', |
| 52 | 52 | 'update' => 'page.update', |
| 53 | 53 | 'destroy' => 'page.destroy' |
| 54 | - ]]); |
|
| 55 | - Route::resource('pageCategory', 'Admin\PageCategoryController', ['names' => [ |
|
| 54 | + ] ]); |
|
| 55 | + Route::resource('pageCategory', 'Admin\PageCategoryController', [ 'names' => [ |
|
| 56 | 56 | 'index' => 'pageCategory.index', |
| 57 | 57 | 'create' => 'pageCategory.create', |
| 58 | 58 | 'store' => 'pageCategory.store', |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | 'edit' => 'pageCategory.edit', |
| 61 | 61 | 'update' => 'pageCategory.update', |
| 62 | 62 | 'destroy' => 'pageCategory.destroy' |
| 63 | - ]]); |
|
| 63 | + ] ]); |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Articles and categories |
| 67 | 67 | */ |
| 68 | - Route::resource('article', 'Admin\ArticleController', ['names' => [ |
|
| 68 | + Route::resource('article', 'Admin\ArticleController', [ 'names' => [ |
|
| 69 | 69 | 'index' => 'article.index', |
| 70 | 70 | 'create' => 'article.create', |
| 71 | 71 | 'store' => 'article.store', |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | 'edit' => 'article.edit', |
| 74 | 74 | 'update' => 'article.update', |
| 75 | 75 | 'destroy' => 'article.destroy' |
| 76 | - ]]); |
|
| 77 | - Route::resource('articleCategory', 'Admin\ArticleCategoryController', ['names' => [ |
|
| 76 | + ] ]); |
|
| 77 | + Route::resource('articleCategory', 'Admin\ArticleCategoryController', [ 'names' => [ |
|
| 78 | 78 | 'index' => 'articleCategory.index', |
| 79 | 79 | 'create' => 'articleCategory.create', |
| 80 | 80 | 'store' => 'articleCategory.store', |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | 'edit' => 'articleCategory.edit', |
| 83 | 83 | 'update' => 'articleCategory.update', |
| 84 | 84 | 'destroy' => 'articleCategory.destroy' |
| 85 | - ]]); |
|
| 85 | + ] ]); |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Feedback |
| 89 | 89 | */ |
| 90 | - Route::resource('feedback', 'Admin\FeedbackController', ['names' => [ |
|
| 90 | + Route::resource('feedback', 'Admin\FeedbackController', [ 'names' => [ |
|
| 91 | 91 | 'index' => 'feedback.index', |
| 92 | 92 | 'create' => 'feedback.create', |
| 93 | 93 | 'store' => 'feedback.store', |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | 'edit' => 'feedback.edit', |
| 96 | 96 | 'update' => 'feedback.update', |
| 97 | 97 | 'destroy' => 'feedback.destroy' |
| 98 | - ]]); |
|
| 98 | + ] ]); |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Comment |
| 102 | 102 | */ |
| 103 | - Route::resource('comment', 'Admin\CommentController', ['names' => [ |
|
| 103 | + Route::resource('comment', 'Admin\CommentController', [ 'names' => [ |
|
| 104 | 104 | 'index' => 'comment.index', |
| 105 | 105 | 'create' => 'comment.create', |
| 106 | 106 | 'store' => 'comment.store', |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'edit' => 'comment.edit', |
| 109 | 109 | 'update' => 'comment.update', |
| 110 | 110 | 'destroy' => 'comment.destroy' |
| 111 | - ]]); |
|
| 111 | + ] ]); |
|
| 112 | 112 | Route::get('comment/{id}/approve', [ |
| 113 | 113 | 'as' => 'comment.approve', 'uses' => 'Admin\CommentController@approve' |
| 114 | 114 | ]); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * Sliders and slides |
| 121 | 121 | */ |
| 122 | - Route::resource('slider', 'Admin\SliderController', ['names' => [ |
|
| 122 | + Route::resource('slider', 'Admin\SliderController', [ 'names' => [ |
|
| 123 | 123 | 'index' => 'slider.index', |
| 124 | 124 | 'create' => 'slider.create', |
| 125 | 125 | 'store' => 'slider.store', |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | 'edit' => 'slider.edit', |
| 128 | 128 | 'update' => 'slider.update', |
| 129 | 129 | 'destroy' => 'slider.destroy' |
| 130 | - ]]); |
|
| 131 | - Route::resource('slide', 'Admin\SlideController', ['names' => [ |
|
| 130 | + ] ]); |
|
| 131 | + Route::resource('slide', 'Admin\SlideController', [ 'names' => [ |
|
| 132 | 132 | 'index' => 'slide.index', |
| 133 | 133 | 'create' => 'slide.create', |
| 134 | 134 | 'store' => 'slide.store', |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | 'edit' => 'slide.edit', |
| 137 | 137 | 'update' => 'slide.update', |
| 138 | 138 | 'destroy' => 'slide.destroy' |
| 139 | - ]]); |
|
| 139 | + ] ]); |
|
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * Images and categories |
| 143 | 143 | */ |
| 144 | - Route::resource('image', 'Admin\ImageController', ['middleware' => ['media.addparameters'], |
|
| 144 | + Route::resource('image', 'Admin\ImageController', [ 'middleware' => [ 'media.addparameters' ], |
|
| 145 | 145 | 'names' => [ |
| 146 | 146 | 'index' => 'image.index', |
| 147 | 147 | 'create' => 'image.create', |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | 'edit' => 'image.edit', |
| 151 | 151 | 'update' => 'image.update', |
| 152 | 152 | 'destroy' => 'image.destroy' |
| 153 | - ]]); |
|
| 154 | - Route::resource('imageCategory', 'Admin\ImageCategoryController', ['names' => [ |
|
| 153 | + ] ]); |
|
| 154 | + Route::resource('imageCategory', 'Admin\ImageCategoryController', [ 'names' => [ |
|
| 155 | 155 | 'index' => 'imageCategory.index', |
| 156 | 156 | 'create' => 'imageCategory.create', |
| 157 | 157 | 'store' => 'imageCategory.store', |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | 'edit' => 'imageCategory.edit', |
| 160 | 160 | 'update' => 'imageCategory.update', |
| 161 | 161 | 'destroy' => 'imageCategory.destroy' |
| 162 | - ]]); |
|
| 162 | + ] ]); |
|
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * Advertising |
| 166 | 166 | */ |
| 167 | - Route::resource('advert', 'Admin\AdvertController', ['names' => [ |
|
| 167 | + Route::resource('advert', 'Admin\AdvertController', [ 'names' => [ |
|
| 168 | 168 | 'index' => 'advert.index', |
| 169 | 169 | 'create' => 'advert.create', |
| 170 | 170 | 'store' => 'advert.store', |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | 'edit' => 'advert.edit', |
| 173 | 173 | 'update' => 'advert.update', |
| 174 | 174 | 'destroy' => 'advert.destroy' |
| 175 | - ]]); |
|
| 176 | - Route::resource('advertLocation', 'Admin\AdvertLocationController', ['names' => [ |
|
| 175 | + ] ]); |
|
| 176 | + Route::resource('advertLocation', 'Admin\AdvertLocationController', [ 'names' => [ |
|
| 177 | 177 | 'index' => 'advertLocation.index', |
| 178 | 178 | 'create' => 'advertLocation.create', |
| 179 | 179 | 'store' => 'advertLocation.store', |
@@ -181,12 +181,12 @@ discard block |
||
| 181 | 181 | 'edit' => 'advertLocation.edit', |
| 182 | 182 | 'update' => 'advertLocation.update', |
| 183 | 183 | 'destroy' => 'advertLocation.destroy' |
| 184 | - ]]); |
|
| 184 | + ] ]); |
|
| 185 | 185 | |
| 186 | 186 | /** |
| 187 | 187 | * Products and categories |
| 188 | 188 | */ |
| 189 | - Route::resource('productCategory', 'Admin\ProductCategoryController', ['names' => [ |
|
| 189 | + Route::resource('productCategory', 'Admin\ProductCategoryController', [ 'names' => [ |
|
| 190 | 190 | 'index' => 'productCategory.index', |
| 191 | 191 | 'create' => 'productCategory.create', |
| 192 | 192 | 'store' => 'productCategory.store', |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | 'edit' => 'productCategory.edit', |
| 195 | 195 | 'update' => 'productCategory.update', |
| 196 | 196 | 'destroy' => 'productCategory.destroy' |
| 197 | - ]]); |
|
| 198 | - Route::resource('product', 'Admin\ProductController', ['names' => [ |
|
| 197 | + ] ]); |
|
| 198 | + Route::resource('product', 'Admin\ProductController', [ 'names' => [ |
|
| 199 | 199 | 'index' => 'product.index', |
| 200 | 200 | 'create' => 'product.create', |
| 201 | 201 | 'store' => 'product.store', |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | 'edit' => 'product.edit', |
| 204 | 204 | 'update' => 'product.update', |
| 205 | 205 | 'destroy' => 'product.destroy' |
| 206 | - ]]); |
|
| 206 | + ] ]); |
|
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * Settings |
| 210 | 210 | */ |
| 211 | 211 | Route::resource('settings', 'Admin\SettingsController', [ |
| 212 | - 'except' => ['delete', 'show'], |
|
| 212 | + 'except' => [ 'delete', 'show' ], |
|
| 213 | 213 | 'names' => [ |
| 214 | 214 | 'index' => 'settings.index', |
| 215 | 215 | 'create' => 'settings.create', |
@@ -218,13 +218,13 @@ discard block |
||
| 218 | 218 | 'edit' => 'settings.edit', |
| 219 | 219 | 'update' => 'settings.update', |
| 220 | 220 | 'destroy' => 'settings.destroy' |
| 221 | - ]]); |
|
| 221 | + ] ]); |
|
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | 224 | * Users |
| 225 | 225 | */ |
| 226 | 226 | Route::resource('user', 'Admin\UserController', [ |
| 227 | - 'except' => ['show'], |
|
| 227 | + 'except' => [ 'show' ], |
|
| 228 | 228 | 'names' => [ |
| 229 | 229 | 'index' => 'user.index', |
| 230 | 230 | 'create' => 'user.create', |
@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | 'edit' => 'user.edit', |
| 234 | 234 | 'update' => 'user.update', |
| 235 | 235 | 'destroy' => 'user.destroy' |
| 236 | - ]]); |
|
| 236 | + ] ]); |
|
| 237 | 237 | |
| 238 | 238 | }); |
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * Authentication |
| 242 | 242 | */ |
| 243 | -Route::group(['middleware' => 'web'], function () { |
|
| 243 | +Route::group([ 'middleware' => 'web' ], function() { |
|
| 244 | 244 | |
| 245 | 245 | Route::get('login', 'Auth\LoginController@showLoginForm')->name('login'); |
| 246 | 246 | Route::post('login', 'Auth\LoginController@login')->name('authPostLogin'); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | /** |
| 261 | 261 | * Images |
| 262 | 262 | */ |
| 263 | -Route::get('/' . env('APP_IMAGE_URL', 'images').'/{imageName}.{imageExtension}', [ |
|
| 263 | +Route::get('/' . env('APP_IMAGE_URL', 'images') . '/{imageName}.{imageExtension}', [ |
|
| 264 | 264 | 'as' => 'getImage', 'uses' => 'Media\ImageController@getImage' |
| 265 | 265 | ]); |
| 266 | 266 | |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'description', 'color']; |
|
| 43 | + protected $fillable = [ 'name', 'description', 'color' ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Columns to exclude from index |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $excludedFromIndex = []; |
|
| 50 | + protected $excludedFromIndex = [ ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Fields to search in fulltext mode |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @return object |
| 84 | 84 | */ |
| 85 | - public function adverts(){ |
|
| 85 | + public function adverts() { |
|
| 86 | 86 | |
| 87 | 87 | return $this->belongsToMany('App\Advert', 'advert_advertlocation', 'advert_id', 'advertlocation_id'); |
| 88 | 88 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param type $query |
| 94 | 94 | * @return object |
| 95 | 95 | */ |
| 96 | - public function scopeRelationships($query){ |
|
| 96 | + public function scopeRelationships($query) { |
|
| 97 | 97 | |
| 98 | 98 | return $query->with('adverts'); |
| 99 | 99 | } |
@@ -32,21 +32,21 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 35 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes that are mass assignable. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $fillable = ['name', 'description', 'class']; |
|
| 42 | + protected $fillable = [ 'name', 'description', 'class' ]; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Columns to exclude from index |
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $excludedFromIndex = []; |
|
| 49 | + protected $excludedFromIndex = [ ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Fields to search in fulltext mode |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return object |
| 88 | 88 | */ |
| 89 | - public function pages(){ |
|
| 89 | + public function pages() { |
|
| 90 | 90 | |
| 91 | 91 | return $this->belongsToMany('App\Page', 'page_pagecategory', 'page_id', 'pagecategory_id'); |
| 92 | 92 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param query $query |
| 98 | 98 | * @return query |
| 99 | 99 | */ |
| 100 | - public function scopeRelationships($query){ |
|
| 100 | + public function scopeRelationships($query) { |
|
| 101 | 101 | |
| 102 | 102 | return $query->with('pages'); |
| 103 | 103 | } |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'description', 'position', 'image_id']; |
|
| 43 | + protected $fillable = [ 'name', 'description', 'position', 'image_id' ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Columns to exclude from index |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $excludedFromIndex = ['image']; |
|
| 50 | + protected $excludedFromIndex = [ 'image' ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Fields to search in fulltext mode |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return object |
| 85 | 85 | */ |
| 86 | - public function images(){ |
|
| 86 | + public function images() { |
|
| 87 | 87 | |
| 88 | 88 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 89 | 89 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param query $query |
| 98 | 98 | * @return query |
| 99 | 99 | */ |
| 100 | - public function scopeRelationships($query){ |
|
| 100 | + public function scopeRelationships($query) { |
|
| 101 | 101 | |
| 102 | 102 | return $query->with('images', 'images.imagecategories'); |
| 103 | 103 | } |
@@ -72,8 +72,7 @@ |
||
| 72 | 72 | { |
| 73 | 73 | if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
| 74 | 74 | return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
| 75 | - } |
|
| 76 | - else{ |
|
| 75 | + } else{ |
|
| 77 | 76 | return $query; |
| 78 | 77 | } |
| 79 | 78 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return \Illuminate\Database\Eloquent\Builder |
| 37 | 37 | */ |
| 38 | - public function scopeFulltextAllColumns(Builder $query){ |
|
| 38 | + public function scopeFulltextAllColumns(Builder $query) { |
|
| 39 | 39 | |
| 40 | 40 | return Helpers::virtualFulltextSearchColumns($query, request('search'), $this->fulltextFields); |
| 41 | 41 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @return \Illuminate\Database\Eloquent\Builder |
| 47 | 47 | */ |
| 48 | - public function scopeOrderByColumns(Builder $query){ |
|
| 48 | + public function scopeOrderByColumns(Builder $query) { |
|
| 49 | 49 | |
| 50 | 50 | return Helpers::orderByColumns($query, $this->defaultOrderBy); |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function scopeExcludeFromIndex(Builder $query) |
| 59 | 59 | { |
| 60 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex) ); |
|
| 60 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function scopeExcludeFromFind(Builder $query) |
| 69 | 69 | { |
| 70 | - if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
|
| 71 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
|
| 70 | + if (isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE) { |
|
| 71 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind)); |
|
| 72 | 72 | } |
| 73 | - else{ |
|
| 73 | + else { |
|
| 74 | 74 | return $query; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return \Illuminate\Database\Eloquent\Builder |
| 82 | 82 | */ |
| 83 | - public function scopeRelationships(Builder $query){ |
|
| 83 | + public function scopeRelationships(Builder $query) { |
|
| 84 | 84 | |
| 85 | 85 | return $query; |
| 86 | 86 | } |
@@ -90,30 +90,30 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return \Illuminate\Database\Eloquent\Builder |
| 92 | 92 | */ |
| 93 | - public function scopeExternalTablesFilter(Builder $query){ |
|
| 93 | + public function scopeExternalTablesFilter(Builder $query) { |
|
| 94 | 94 | |
| 95 | - if(Request::input('relation')){ |
|
| 95 | + if (Request::input('relation')) { |
|
| 96 | 96 | |
| 97 | - $allTables = []; |
|
| 97 | + $allTables = [ ]; |
|
| 98 | 98 | |
| 99 | 99 | $relations = explode(',', Request::input('relation')); |
| 100 | 100 | |
| 101 | - foreach ($relations as $relation){ |
|
| 101 | + foreach ($relations as $relation) { |
|
| 102 | 102 | |
| 103 | 103 | $keyvalue = explode(':', $relation); |
| 104 | 104 | |
| 105 | - $key = trim($keyvalue[0]); |
|
| 106 | - $value = trim($keyvalue[1]); |
|
| 105 | + $key = trim($keyvalue[ 0 ]); |
|
| 106 | + $value = trim($keyvalue[ 1 ]); |
|
| 107 | 107 | |
| 108 | - $allTables[$key] = $value; |
|
| 108 | + $allTables[ $key ] = $value; |
|
| 109 | 109 | |
| 110 | - if(is_numeric($value) == TRUE){ |
|
| 110 | + if (is_numeric($value) == TRUE) { |
|
| 111 | 111 | |
| 112 | - $query->where(strtolower($key)."_id", '=', $value); |
|
| 112 | + $query->where(strtolower($key) . "_id", '=', $value); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - request()->merge(['external_tables_filter' => $allTables]); |
|
| 116 | + request()->merge([ 'external_tables_filter' => $allTables ]); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $query; |
@@ -126,8 +126,7 @@ |
||
| 126 | 126 | { |
| 127 | 127 | return round((($thisValue / ($lastValue / 100)) - 100), $round); |
| 128 | 128 | |
| 129 | - } |
|
| 130 | - else { |
|
| 129 | + } else { |
|
| 131 | 130 | |
| 132 | 131 | return 0; |
| 133 | 132 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @var array |
| 43 | 43 | */ |
| 44 | - protected $gaData = []; |
|
| 44 | + protected $gaData = [ ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Constructor |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * Module name for blade |
| 59 | 59 | */ |
| 60 | 60 | $temp = explode('.', $this->moduleBasicRoute); |
| 61 | - View::share('moduleNameBlade', $temp[0] . "_module_" . $temp[1]); |
|
| 61 | + View::share('moduleNameBlade', $temp[ 0 ] . "_module_" . $temp[ 1 ]); |
|
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | } |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | $ga = $this->getGAValues(); |
| 79 | 79 | } else { |
| 80 | 80 | |
| 81 | - $ga = []; |
|
| 81 | + $ga = [ ]; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $statistics = [ |
| 85 | 85 | 'ga' => $ga |
| 86 | 86 | ]; |
| 87 | 87 | |
| 88 | - return view('admin.modules.dashboard.index', ['statistics' => $statistics]); |
|
| 88 | + return view('admin.modules.dashboard.index', [ 'statistics' => $statistics ]); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * Get the data |
| 102 | 102 | */ |
| 103 | - $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 103 | + $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Calculate total |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $total = 0; |
| 109 | 109 | foreach ($data as $value) { |
| 110 | 110 | |
| 111 | - $total += $value[$type]; |
|
| 111 | + $total += $value[ $type ]; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | return $total; |
@@ -24,5 +24,5 @@ |
||
| 24 | 24 | protected $arValidationArray = [ |
| 25 | 25 | 'name' => 'required|max:255|unique:settings,name', |
| 26 | 26 | 'value' => 'max:255', |
| 27 | - 'description' => 'max:255']; |
|
| 27 | + 'description' => 'max:255' ]; |
|
| 28 | 28 | } |