@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use App\Transaction; |
26 | 26 | use App\User; |
27 | 27 | |
28 | -class AdminModuleController extends Controller{ |
|
28 | +class AdminModuleController extends Controller { |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Module name |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * Module name for blade |
145 | 145 | */ |
146 | 146 | $temp = explode('.', $this->moduleBasicRoute); |
147 | - View::share('moduleNameBlade', strtolower($temp[0] . "_module_" . $temp[1])); |
|
147 | + View::share('moduleNameBlade', strtolower($temp[ 0 ] . "_module_" . $temp[ 1 ])); |
|
148 | 148 | |
149 | 149 | } |
150 | 150 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @param $amount |
158 | 158 | */ |
159 | 159 | protected function _saveTransation($status_id = 1, $user_id, $amount, |
160 | - $campaign_id = null, $payment_id = null, $recommendation_id = null){ |
|
160 | + $campaign_id = null, $payment_id = null, $recommendation_id = null) { |
|
161 | 161 | |
162 | 162 | /** |
163 | 163 | * Save transaction |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param boolean $update |
188 | 188 | * @return boolean |
189 | 189 | */ |
190 | - public function saveMediaToStorage($object, $request, $update = FALSE){ |
|
190 | + public function saveMediaToStorage($object, $request, $update = FALSE) { |
|
191 | 191 | |
192 | 192 | return FALSE; |
193 | 193 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | return env('ADMIN_PAGINATE', 10); |
205 | 205 | } |
206 | - else{ |
|
206 | + else { |
|
207 | 207 | |
208 | 208 | return $this->paginateRows; |
209 | 209 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @param object $object |
216 | 216 | * @param Request $request |
217 | 217 | */ |
218 | - public function associateRelationships($object, Request $request){ |
|
218 | + public function associateRelationships($object, Request $request) { |
|
219 | 219 | |
220 | 220 | } |
221 | 221 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @param object $object |
226 | 226 | * @param Request $request |
227 | 227 | */ |
228 | - public function associateRelationshipsWithID($object, Request $request){ |
|
228 | + public function associateRelationshipsWithID($object, Request $request) { |
|
229 | 229 | |
230 | 230 | } |
231 | 231 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * |
235 | 235 | * @param object $object |
236 | 236 | */ |
237 | - public function resetCache($object){ |
|
237 | + public function resetCache($object) { |
|
238 | 238 | |
239 | 239 | } |
240 | 240 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @param $arResult |
245 | 245 | * @return mixed |
246 | 246 | */ |
247 | - public function changeEditResultField($arResult){ |
|
247 | + public function changeEditResultField($arResult) { |
|
248 | 248 | return $arResult; |
249 | 249 | } |
250 | 250 | |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | /** |
279 | 279 | * Choose the view |
280 | 280 | */ |
281 | - if(empty($this->customView['index']) == TRUE){ |
|
281 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
282 | 282 | $view = $this->moduleBasicTemplatePath . '.index'; |
283 | 283 | } |
284 | - else{ |
|
284 | + else { |
|
285 | 285 | $view = $this->customView; |
286 | 286 | } |
287 | 287 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | /** |
290 | 290 | * Return page |
291 | 291 | */ |
292 | - return view($view, ['results' => $arResults]); |
|
292 | + return view($view, [ 'results' => $arResults ]); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | /** |
303 | 303 | * Choose the view |
304 | 304 | */ |
305 | - if(empty($this->customView['index']) == TRUE){ |
|
305 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
306 | 306 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
307 | 307 | } |
308 | - else{ |
|
308 | + else { |
|
309 | 309 | $view = $this->customView; |
310 | 310 | } |
311 | 311 | |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | * Change the validation array |
328 | 328 | */ |
329 | 329 | foreach ($this->arValidationArray as $name => $value) { |
330 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
331 | - $this->arValidationArray[$name] = $value . ',NULL,id,deleted_at,NULL'; |
|
330 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
331 | + $this->arValidationArray[ $name ] = $value . ',NULL,id,deleted_at,NULL'; |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
@@ -351,16 +351,16 @@ discard block |
||
351 | 351 | /** |
352 | 352 | * Datetime |
353 | 353 | */ |
354 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
354 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
355 | 355 | |
356 | - $object->{$name} = str_replace('T', ' ', $request->input($name)). ':00'; |
|
356 | + $object->{$name} = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
357 | 357 | } |
358 | 358 | else { |
359 | 359 | |
360 | 360 | /** |
361 | 361 | * Change to null if needed |
362 | 362 | */ |
363 | - if(strlen($request->$name) < 1){ |
|
363 | + if (strlen($request->$name) < 1) { |
|
364 | 364 | $object->{$name} = null; |
365 | 365 | } |
366 | 366 | else { |
@@ -411,28 +411,28 @@ discard block |
||
411 | 411 | * Get the row |
412 | 412 | */ |
413 | 413 | $arResults = $modelClass::where('id', $id)->relationships()->excludeFromFind()->get(); |
414 | - $arResults = $arResults[0]; |
|
414 | + $arResults = $arResults[ 0 ]; |
|
415 | 415 | |
416 | 416 | /** |
417 | 417 | * Row does not exist - redirect |
418 | 418 | */ |
419 | 419 | if (count($arResults) == 0) { |
420 | 420 | |
421 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
421 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
425 | 425 | * Set the put method for update |
426 | 426 | */ |
427 | - $arResults['_method'] = 'PUT'; |
|
427 | + $arResults[ '_method' ] = 'PUT'; |
|
428 | 428 | |
429 | 429 | /** |
430 | 430 | * Choose the view |
431 | 431 | */ |
432 | - if(empty($this->customView['index']) == TRUE){ |
|
432 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
433 | 433 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
434 | 434 | } |
435 | - else{ |
|
435 | + else { |
|
436 | 436 | $view = $this->customView; |
437 | 437 | } |
438 | 438 | |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | /** |
442 | 442 | * Return page |
443 | 443 | */ |
444 | - return view($view, ['results' => $arResults]); |
|
444 | + return view($view, [ 'results' => $arResults ]); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
@@ -470,8 +470,8 @@ discard block |
||
470 | 470 | */ |
471 | 471 | foreach ($this->arValidationArray as $name => $value) { |
472 | 472 | |
473 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
474 | - $this->arValidationArray[$name] = $value . ','.$id.',id,deleted_at,NULL'; |
|
473 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
474 | + $this->arValidationArray[ $name ] = $value . ',' . $id . ',id,deleted_at,NULL'; |
|
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | */ |
492 | 492 | if ($arResults == FALSE) { |
493 | 493 | |
494 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
494 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | /** |
@@ -508,10 +508,10 @@ discard block |
||
508 | 508 | * Binary fields will not be updated if empty |
509 | 509 | * |
510 | 510 | */ |
511 | - if(in_array($name, $this->binaryFields)){ |
|
511 | + if (in_array($name, $this->binaryFields)) { |
|
512 | 512 | |
513 | 513 | } |
514 | - else{ |
|
514 | + else { |
|
515 | 515 | |
516 | 516 | /** |
517 | 517 | * Empty exception |
@@ -521,26 +521,26 @@ discard block |
||
521 | 521 | /** |
522 | 522 | * Datetime |
523 | 523 | */ |
524 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
524 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
525 | 525 | |
526 | - $arResults->$name = str_replace('T', ' ', $request->input($name)). ':00'; |
|
526 | + $arResults->$name = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
527 | 527 | } |
528 | 528 | else { |
529 | 529 | $arResults->$name = $request->input($name); |
530 | 530 | } |
531 | 531 | } |
532 | 532 | |
533 | - else{ |
|
533 | + else { |
|
534 | 534 | |
535 | 535 | /** |
536 | 536 | * Numeric zero ? |
537 | 537 | */ |
538 | - if(isset($request->name) && is_numeric($request->input($name)) == TRUE){ |
|
538 | + if (isset($request->name) && is_numeric($request->input($name)) == TRUE) { |
|
539 | 539 | |
540 | 540 | $arResults->$name = $request->input($name); |
541 | 541 | } |
542 | 542 | |
543 | - else{ |
|
543 | + else { |
|
544 | 544 | $arResults->$name = NULL; |
545 | 545 | } |
546 | 546 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | /** |
558 | 558 | * Save media to storage |
559 | 559 | */ |
560 | - if($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE){ |
|
560 | + if ($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE) { |
|
561 | 561 | |
562 | 562 | // Update binary fields |
563 | 563 | foreach ($this->binaryFields as $name => $value) { |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | if (empty($request->$value) == FALSE) { |
566 | 566 | $arResults->$value = $request->$value; |
567 | 567 | } |
568 | - else{ |
|
568 | + else { |
|
569 | 569 | $arResults->$value = NULL; |
570 | 570 | } |
571 | 571 | } |
@@ -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 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function boot() |
15 | 15 | { |
16 | 16 | // |
17 | - require_once app_path().'/Http/Helpers.php'; |
|
17 | + require_once app_path() . '/Http/Helpers.php'; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -57,7 +57,7 @@ |
||
57 | 57 | protected function unauthenticated($request, AuthenticationException $exception) |
58 | 58 | { |
59 | 59 | if ($request->expectsJson()) { |
60 | - return response()->json(['error' => 'Unauthenticated.'], 401); |
|
60 | + return response()->json([ 'error' => 'Unauthenticated.' ], 401); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return redirect()->guest('login'); |
@@ -41,29 +41,29 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @var array |
43 | 43 | */ |
44 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
44 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * The attributes that are mass assignable. |
48 | 48 | * |
49 | 49 | * @var array |
50 | 50 | */ |
51 | - protected $fillable = ['name', 'email', 'password', 'age', 'blacklisted', 'ip', 'activation_code', 'active', |
|
52 | - 'fname', 'sname', 'bno', 'city', 'citypart', 'street', 'hno', 'zip', 'registration_data', 'phone']; |
|
51 | + protected $fillable = [ 'name', 'email', 'password', 'age', 'blacklisted', 'ip', 'activation_code', 'active', |
|
52 | + 'fname', 'sname', 'bno', 'city', 'citypart', 'street', 'hno', 'zip', 'registration_data', 'phone' ]; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * The attributes excluded from the model's JSON form. |
56 | 56 | * |
57 | 57 | * @var array |
58 | 58 | */ |
59 | - protected $hidden = ['password', 'remember_token']; |
|
59 | + protected $hidden = [ 'password', 'remember_token' ]; |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Columns to exclude from index |
63 | 63 | * |
64 | 64 | * @var array |
65 | 65 | */ |
66 | - protected $excludedFromIndex = ['password']; |
|
66 | + protected $excludedFromIndex = [ 'password' ]; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Fields to search in fulltext mode |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @return object |
100 | 100 | */ |
101 | - public function articles(){ |
|
101 | + public function articles() { |
|
102 | 102 | |
103 | 103 | return $this->hasMany('App\Article', 'user_id'); |
104 | 104 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @return object |
110 | 110 | */ |
111 | - public function usergroups(){ |
|
111 | + public function usergroups() { |
|
112 | 112 | |
113 | 113 | return $this->belongsTo('App\Usergroup', 'usergroup_id'); |
114 | 114 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @param query $query |
120 | 120 | * @return query |
121 | 121 | */ |
122 | - public function scopeRelationships($query){ |
|
122 | + public function scopeRelationships($query) { |
|
123 | 123 | |
124 | 124 | return $query->with('usergroups'); |
125 | 125 | } |
@@ -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; |
@@ -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,15 +31,15 @@ |
||
31 | 31 | public function handle(Request $request, Closure $next) |
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 | 39 | |
40 | - $array = ['other_tables' => |
|
40 | + $array = [ 'other_tables' => |
|
41 | 41 | [ |
42 | - $model => $modelWithNamespace::orderBy('id', 'desc')->get(['id', 'name', 'url', 'image_extension']) |
|
42 | + $model => $modelWithNamespace::orderBy('id', 'desc')->get([ 'id', 'name', 'url', 'image_extension' ]) |
|
43 | 43 | ] |
44 | 44 | ]; |
45 | 45 |
@@ -33,14 +33,14 @@ 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']; |
|
43 | + protected $fillable = [ 'name' ]; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Fields to search in fulltext mode |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return object |
72 | 72 | */ |
73 | - public function users(){ |
|
73 | + public function users() { |
|
74 | 74 | |
75 | 75 | return $this->hasMany('App\User', 'usergroup_id'); |
76 | 76 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @param query $query |
82 | 82 | * @return query |
83 | 83 | */ |
84 | - public function scopeRelationships($query){ |
|
84 | + public function scopeRelationships($query) { |
|
85 | 85 | |
86 | 86 | return $query->with('users'); |
87 | 87 | } |