Completed
Push — master ( be44c5...20f323 )
by Jan
07:43
created
app/Http/Controllers/Admin/AdminModuleController.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      * Store a newly created resource in storage.
254 254
      *
255 255
      * @param  Request  $request
256
-     * @return Response
256
+     * @return \Illuminate\Http\RedirectResponse
257 257
      */
258 258
     public function store(Request $request) {
259 259
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      *
373 373
      * @param  Request  $request
374 374
      * @param  int  $id
375
-     * @return Response
375
+     * @return \Illuminate\Http\RedirectResponse
376 376
      */
377 377
     public function update(Request $request, $id) {
378 378
         
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
      * Remove the specified resource from storage.
499 499
      *
500 500
      * @param  int  $id
501
-     * @return Response
501
+     * @return \Illuminate\Http\RedirectResponse
502 502
      */
503 503
     public function destroy($id) {
504 504
         /**
Please login to merge, or discard this patch.
Braces   +8 added lines, -18 removed lines patch added patch discarded remove patch
@@ -151,8 +151,7 @@  discard block
 block discarded – undo
151 151
         if ($this->paginateRows == NULL) {
152 152
 
153 153
             return env('ADMIN_PAGINATE', 10);
154
-        }
155
-        else{
154
+        } else{
156 155
 
157 156
             return $this->paginateRows;
158 157
         }
@@ -219,8 +218,7 @@  discard block
 block discarded – undo
219 218
          */
220 219
         if(empty($this->customView['index']) == TRUE){
221 220
             $view = $this->moduleBasicTemplatePath . '.index';
222
-        }
223
-        else{
221
+        } else{
224 222
             $view = $this->customView;
225 223
         } 
226 224
         
@@ -242,8 +240,7 @@  discard block
 block discarded – undo
242 240
          */
243 241
         if(empty($this->customView['index']) == TRUE){
244 242
             $view = $this->moduleBasicTemplatePath . '.create_edit';
245
-        }
246
-        else{
243
+        } else{
247 244
             $view = $this->customView;
248 245
         }
249 246
         
@@ -349,8 +346,7 @@  discard block
 block discarded – undo
349 346
          */
350 347
         if(empty($this->customView['index']) == TRUE){
351 348
             $view = $this->moduleBasicTemplatePath . '.create_edit';
352
-        }
353
-        else{
349
+        } else{
354 350
             $view = $this->customView;
355 351
         }
356 352
     
@@ -431,17 +427,14 @@  discard block
 block discarded – undo
431 427
                  * if($request->has($name)){
432 428
                     $this->arValidationArray[$name] = $value . ',' . $id;
433 429
                 }**/
434
-            }
435
-            else{
430
+            } else{
436 431
                 
437 432
                /**
438 433
                 * Empty exception
439 434
                 */
440 435
                if (empty($request->input($name)) == FALSE) {
441 436
                    $arResults->$name = $request->input($name);
442
-               }
443
-               
444
-               else{
437
+               } else{
445 438
                    
446 439
                    /**
447 440
                     * Numeric zero ?
@@ -449,9 +442,7 @@  discard block
 block discarded – undo
449 442
                    if(@is_numeric($request->input($name)) == TRUE){
450 443
                        
451 444
                       $arResults->$name = $request->input($name);
452
-                   }
453
-                   
454
-                   else{
445
+                   } else{
455 446
                     $arResults->$name = NULL;
456 447
                    }
457 448
                }
@@ -475,8 +466,7 @@  discard block
 block discarded – undo
475 466
                 
476 467
                 if (empty($request->$value) == FALSE) {
477 468
                    $arResults->$value = $request->$value;
478
-                }
479
-                else{
469
+                } else{
480 470
                     $arResults->$value = NULL;
481 471
                 }
482 472
             }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 use Illuminate\Support\Facades\View;
20 20
 use App\Http\Controllers\Controller;
21 21
 
22
-class AdminModuleController extends Controller{
22
+class AdminModuleController extends Controller {
23 23
 
24 24
     /**
25 25
      * Module name
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
          * Module name for blade
125 125
          */
126 126
         $temp = explode('.', $this->moduleBasicRoute);
127
-        View::share('moduleNameBlade', strtolower($temp[0] . "_module_" . $temp[1]));
127
+        View::share('moduleNameBlade', strtolower($temp[ 0 ] . "_module_" . $temp[ 1 ]));
128 128
 
129 129
     }
130 130
     
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      * @param boolean $update
137 137
      * @return boolean
138 138
      */
139
-    public function saveMediaToStorage($object, $request, $update = FALSE){
139
+    public function saveMediaToStorage($object, $request, $update = FALSE) {
140 140
         
141 141
         return FALSE;
142 142
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
             return env('ADMIN_PAGINATE', 10);
154 154
         }
155
-        else{
155
+        else {
156 156
 
157 157
             return $this->paginateRows;
158 158
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      * @param object $object
165 165
      * @param Request $request
166 166
      */
167
-    public function associateRelationships($object, Request $request){
167
+    public function associateRelationships($object, Request $request) {
168 168
         
169 169
     }
170 170
     
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * @param object $object
175 175
      * @param Request $request
176 176
      */
177
-    public function associateRelationshipsWithID($object, Request $request){
177
+    public function associateRelationshipsWithID($object, Request $request) {
178 178
         
179 179
     }
180 180
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      * 
184 184
      * @param object $object
185 185
      */
186
-    public function resetCache($object){
186
+    public function resetCache($object) {
187 187
         
188 188
     }
189 189
 
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
         /**
218 218
          * Choose the view
219 219
          */
220
-        if(empty($this->customView['index']) == TRUE){
220
+        if (empty($this->customView[ 'index' ]) == TRUE) {
221 221
             $view = $this->moduleBasicTemplatePath . '.index';
222 222
         }
223
-        else{
223
+        else {
224 224
             $view = $this->customView;
225 225
         } 
226 226
         
227 227
         /**
228 228
          * Return page
229 229
          */
230
-        return view($view, array_merge(['results' => $arResults]));
230
+        return view($view, array_merge([ 'results' => $arResults ]));
231 231
     }
232 232
 
233 233
     /**
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
         /**
241 241
          * Choose the view
242 242
          */
243
-        if(empty($this->customView['index']) == TRUE){
243
+        if (empty($this->customView[ 'index' ]) == TRUE) {
244 244
             $view = $this->moduleBasicTemplatePath . '.create_edit';
245 245
         }
246
-        else{
246
+        else {
247 247
             $view = $this->customView;
248 248
         }
249 249
         
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
          * Change the validation array
266 266
          */
267 267
         foreach ($this->arValidationArray as $name => $value) {
268
-            if(strpos($this->arValidationArray[$name], 'unique') > 0){
269
-                $this->arValidationArray[$name] = $value . ',NULL,id,deleted_at,NULL';
268
+            if (strpos($this->arValidationArray[ $name ], 'unique') > 0) {
269
+                $this->arValidationArray[ $name ] = $value . ',NULL,id,deleted_at,NULL';
270 270
             }
271 271
         }
272 272
 
@@ -329,35 +329,35 @@  discard block
 block discarded – undo
329 329
          * Get the row
330 330
          */
331 331
         $arResults = $modelClass::where('id', $id)->relationships()->excludeFromFind()->get();
332
-        $arResults = $arResults[0];
332
+        $arResults = $arResults[ 0 ];
333 333
     
334 334
         /**
335 335
          * Row does not exist - redirect
336 336
          */
337 337
         if (count($arResults) == 0) {
338 338
 
339
-            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]);
339
+            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]);
340 340
         }
341 341
 
342 342
         /**
343 343
          * Set the put method for update
344 344
          */
345
-        $arResults['_method'] = 'PUT';
345
+        $arResults[ '_method' ] = 'PUT';
346 346
         
347 347
         /**
348 348
          * Choose the view
349 349
          */
350
-        if(empty($this->customView['index']) == TRUE){
350
+        if (empty($this->customView[ 'index' ]) == TRUE) {
351 351
             $view = $this->moduleBasicTemplatePath . '.create_edit';
352 352
         }
353
-        else{
353
+        else {
354 354
             $view = $this->customView;
355 355
         }
356 356
     
357 357
         /**
358 358
          * Return page
359 359
          */
360
-        return view($view, ['results' => $arResults]);
360
+        return view($view, [ 'results' => $arResults ]);
361 361
     }
362 362
 
363 363
     /**
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
          */
385 385
         foreach ($this->arValidationArray as $name => $value) {
386 386
             
387
-            if(strpos($this->arValidationArray[$name], 'unique') > 0){
388
-                $this->arValidationArray[$name] = $value . ','.$id.',id,deleted_at,NULL';
387
+            if (strpos($this->arValidationArray[ $name ], 'unique') > 0) {
388
+                $this->arValidationArray[ $name ] = $value . ',' . $id . ',id,deleted_at,NULL';
389 389
             }
390 390
         }
391 391
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
          */
406 406
         if ($arResults == FALSE) {
407 407
 
408
-            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]);
408
+            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]);
409 409
         }
410 410
         
411 411
         /**
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
              * Binary fields will not be updated if empty
423 423
              *
424 424
              */
425
-            if(in_array($name, $this->binaryFields)){
425
+            if (in_array($name, $this->binaryFields)) {
426 426
 
427 427
             }
428
-            else{
428
+            else {
429 429
                 
430 430
                /**
431 431
                 * Empty exception
@@ -434,17 +434,17 @@  discard block
 block discarded – undo
434 434
                    $arResults->$name = $request->input($name);
435 435
                }
436 436
                
437
-               else{
437
+               else {
438 438
                    
439 439
                    /**
440 440
                     * Numeric zero ?
441 441
                     */
442
-                   if(isset($request->name) && is_numeric($request->input($name)) == TRUE){
442
+                   if (isset($request->name) && is_numeric($request->input($name)) == TRUE) {
443 443
                        
444 444
                       $arResults->$name = $request->input($name);
445 445
                    }
446 446
                    
447
-                   else{
447
+                   else {
448 448
                     $arResults->$name = NULL;
449 449
                    }
450 450
                }
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         /**
462 462
          * Save media to storage
463 463
          */
464
-        if($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE){
464
+        if ($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE) {
465 465
             
466 466
             // Update binary fields
467 467
             foreach ($this->binaryFields as $name => $value) {
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
                 if (empty($request->$value) == FALSE) {
470 470
                    $arResults->$value = $request->$value;
471 471
                 }
472
-                else{
472
+                else {
473 473
                     $arResults->$value = NULL;
474 474
                 }
475 475
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * Store function override
36 36
      *
37 37
      * @param  Request  $request
38
-     * @return Response
38
+     * @return \Illuminate\Http\RedirectResponse
39 39
      */
40 40
     public function store(Request $request)
41 41
     {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      *
65 65
      * @param  Request  $request
66 66
      * @param  integer  $id
67
-     * @return Response
67
+     * @return \Illuminate\Http\RedirectResponse
68 68
      */
69 69
     public function update(Request $request, $id)
70 70
     {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     protected $arValidationArray = [
30 30
         'name' => 'required|max:255',
31 31
         'email' => 'required|email|max:255|unique:users,email',
32
-        'password' => 'required|confirmed|min:6'];
32
+        'password' => 'required|confirmed|min:6' ];
33 33
 
34 34
     /**
35 35
      * Store function override
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
          * Create row
49 49
          */
50 50
         User::create([
51
-            'name' => $request['name'],
52
-            'email' => $request['email'],
53
-            'password' => Hash::make($request['password']),
51
+            'name' => $request[ 'name' ],
52
+            'email' => $request[ 'email' ],
53
+            'password' => Hash::make($request[ 'password' ]),
54 54
         ]);
55 55
         
56 56
         /**
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
          */
74 74
         $this->validate($request, [
75 75
                     'name' => 'required|max:255',
76
-                    'email' => 'required|email|max:255|unique:users,email_address,'.$id,
77
-                    'password' => 'required|confirmed|min:6']);
76
+                    'email' => 'required|email|max:255|unique:users,email_address,' . $id,
77
+                    'password' => 'required|confirmed|min:6' ]);
78 78
         
79 79
         /**
80 80
          * Get the row
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
         /**
85 85
          * Row does not exist - redirect
86 86
          */
87
-        if($arResults == FALSE){
87
+        if ($arResults == FALSE) {
88 88
             
89
-            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]);
89
+            return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]);
90 90
         }
91 91
         
92 92
         /**
93 93
          * Set updated values
94 94
          */
95
-        $arResults->name = $request['name'];
96
-        $arResults->email = $request['email'];
95
+        $arResults->name = $request[ 'name' ];
96
+        $arResults->email = $request[ 'email' ];
97 97
       
98 98
         /**
99 99
          * Possible password change
100 100
          */
101
-        if($request['password'] != '######'){
102
-            $arResults->password  = Hash::make($request['password']);
101
+        if ($request[ 'password' ] != '######') {
102
+            $arResults->password = Hash::make($request[ 'password' ]);
103 103
         }
104 104
         
105 105
         /**
Please login to merge, or discard this patch.
app/Http/Controllers/Media/ImageController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
 
17 17
 use App\Helpers;
18 18
 use Illuminate\Http\Request;
19
-
20 19
 use App\Http\Controllers\Controller;
21 20
 use App\Image;
22 21
 use Illuminate\Support\Facades\Response;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
         /**
53 53
          * File not cached
54 54
          */
55
-        else{
55
+        else {
56 56
             
57 57
             /**
58 58
              * Get META information
59 59
              */
60
-            $imageMeta = Image::where(['url' => $request->imageName, 'image_extension' => $request->imageExtension])->first(['image_mime_type', 'image_size', 'id', 'updated_at', 'image_etag']);
60
+            $imageMeta = Image::where([ 'url' => $request->imageName, 'image_extension' => $request->imageExtension ])->first([ 'image_mime_type', 'image_size', 'id', 'updated_at', 'image_etag' ]);
61 61
             
62 62
             /**
63 63
              * File does not exist
64 64
              */
65
-            if(empty($imageMeta) == TRUE){
65
+            if (empty($imageMeta) == TRUE) {
66 66
                 App::abort(404);
67 67
             }
68 68
             
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             'Content-Type'              => $imageMeta->image_mime_type,
92 92
             'Content-Transfer-Encoding' => 'binary',
93 93
             'Pragma'                    => 'public',
94
-            'Expires'                   => Carbon::createFromTimestamp(time()+3600)->toRfc2822String(),
94
+            'Expires'                   => Carbon::createFromTimestamp(time() + 3600)->toRfc2822String(),
95 95
             'Last-Modified'             => $imageMeta->updated_at->toRfc2822String(),
96 96
             'Etag'                      => $imageMeta->image_etag,
97 97
         );
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
         /**
100 100
          * Response code cached
101 101
          */
102
-        if( (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $imageMeta->image_etag)
103
-                || (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $imageMeta->updated_at->toRfc2822String()) ){
102
+        if ((isset($_SERVER[ 'HTTP_IF_NONE_MATCH' ]) && $_SERVER[ 'HTTP_IF_NONE_MATCH' ] == $imageMeta->image_etag)
103
+                || (isset($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ]) && $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ] == $imageMeta->updated_at->toRfc2822String())) {
104 104
             
105 105
             $responseCode = 304;
106 106
         }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         /**
109 109
          * Response code not cached, but OK
110 110
          */
111
-        else{
111
+        else {
112 112
             
113 113
             $responseCode = 200;
114 114
         }
Please login to merge, or discard this patch.
app/Http/Helpers.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
      *
103 103
      * @param string $module
104 104
      * @param array $possibleParameters
105
-     * @return boolean
105
+     * @return false|string
106 106
      */
107 107
     public static function resetSaveIndexParameters($module, $possibleParameters = ['search', 'orderbycolumn', 'orderbytype', 'relation'])
108 108
     {
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
                  */
45 45
                 if (is_numeric($fieldName) == TRUE) {
46 46
                     $fieldName = $fieldAttributes;
47
-                    $fieldAttributes = ['operator' => '=', 'prefix' => '', 'sufix' => ''];
47
+                    $fieldAttributes = [ 'operator' => '=', 'prefix' => '', 'sufix' => '' ];
48 48
                 }
49
-                if (isset($fieldAttributes['operator']) == FALSE) {
50
-                    $fieldAttributes['operator'] = '=';
49
+                if (isset($fieldAttributes[ 'operator' ]) == FALSE) {
50
+                    $fieldAttributes[ 'operator' ] = '=';
51 51
                 }
52
-                if (isset($fieldAttributes['prefix']) == FALSE) {
53
-                    $fieldAttributes['prefix'] = '';
52
+                if (isset($fieldAttributes[ 'prefix' ]) == FALSE) {
53
+                    $fieldAttributes[ 'prefix' ] = '';
54 54
                 }
55
-                if (isset($fieldAttributes['sufix']) == FALSE) {
56
-                    $fieldAttributes['sufix'] = '';
55
+                if (isset($fieldAttributes[ 'sufix' ]) == FALSE) {
56
+                    $fieldAttributes[ 'sufix' ] = '';
57 57
                 }
58 58
 
59 59
                 /**
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
                  */
62 62
                 if ($first == TRUE) {
63 63
 
64
-                    $query->where($fieldName, $fieldAttributes['operator'], $fieldAttributes['prefix'] . $word
65
-                        . $fieldAttributes['sufix']);
64
+                    $query->where($fieldName, $fieldAttributes[ 'operator' ], $fieldAttributes[ 'prefix' ] . $word
65
+                        . $fieldAttributes[ 'sufix' ]);
66 66
 
67 67
                     $first = FALSE;
68 68
                 } else {
69
-                    $query->orWhere($fieldName, $fieldAttributes['operator'], $fieldAttributes['prefix'] . $word
70
-                        . $fieldAttributes['sufix']);
69
+                    $query->orWhere($fieldName, $fieldAttributes[ 'operator' ], $fieldAttributes[ 'prefix' ] . $word
70
+                        . $fieldAttributes[ 'sufix' ]);
71 71
                 }
72 72
             }
73 73
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * @param array $possibleParameters
105 105
      * @return boolean
106 106
      */
107
-    public static function resetSaveIndexParameters($module, $possibleParameters = ['search', 'orderbycolumn', 'orderbytype', 'relation'])
107
+    public static function resetSaveIndexParameters($module, $possibleParameters = [ 'search', 'orderbycolumn', 'orderbytype', 'relation' ])
108 108
     {
109 109
 
110 110
         /**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
          */
118 118
         foreach ($allParameters as $parameter => $value) {
119 119
 
120
-            $cacheKey = implode('.', [$module, Auth::user()->id, $parameter]);
120
+            $cacheKey = implode('.', [ $module, Auth::user()->id, $parameter ]);
121 121
 
122 122
             /**
123 123
              * Reset
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             if (empty($value) == TRUE) {
126 126
 
127 127
                 Cache::forget($cacheKey);
128
-                unset($allParameters[$parameter]);
128
+                unset($allParameters[ $parameter ]);
129 129
             } /**
130 130
              * Save
131 131
              */ else {
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
          */
140 140
         foreach ($possibleParameters as $parameter => $value) {
141 141
 
142
-            $cacheKey = implode('.', [$module, Auth::user()->id, $value]);
142
+            $cacheKey = implode('.', [ $module, Auth::user()->id, $value ]);
143 143
 
144
-            $allParameters[$value] = Cache::get($cacheKey);
144
+            $allParameters[ $value ] = Cache::get($cacheKey);
145 145
         }
146 146
 
147 147
         /**
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
             if (preg_match('/content: \$fa-var-(.*)\;/', $row, $matches) == TRUE) {
251 251
 
252
-                $icons[] = "fa-" . $matches[1];
252
+                $icons[ ] = "fa-" . $matches[ 1 ];
253 253
             }
254 254
 
255 255
         }
Please login to merge, or discard this patch.
app/Http/Middleware/MediaImageSelect.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
      *
25 25
      * @param Request $request
26 26
      * @param Closure $next
27
-     * @param array $models
28 27
      * @return mixed
29 28
      */
30 29
     public function handle($request, Closure $next)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
     public function handle($request, Closure $next)
31 31
     {
32 32
         $intArgs = func_num_args();
33
-        for($a = 2; $a < $intArgs; $a++){
33
+        for ($a = 2; $a < $intArgs; $a++) {
34 34
             
35 35
             $model = func_get_arg($a);
36
-            $modelWithNamespace = 'App\\'.$model;
36
+            $modelWithNamespace = 'App\\' . $model;
37 37
             
38 38
             
39
-            $array = ['other_tables' =>
39
+            $array = [ 'other_tables' =>
40 40
             [
41
-                $model => $modelWithNamespace::orderBy('id', 'desc')->get(['id', 'name', 'url', 'image_extension'])
41
+                $model => $modelWithNamespace::orderBy('id', 'desc')->get([ 'id', 'name', 'url', 'image_extension' ])
42 42
             ]
43 43
                 ];
44 44
             
Please login to merge, or discard this patch.
app/Image.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * Image category link
100 100
      * 
101
-     * @return object
101
+     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
102 102
      */
103 103
     public function imagecategories(){
104 104
         
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     /**
109 109
      * Slide link
110 110
      * 
111
-     * @return object
111
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
112 112
      */
113 113
     public function slides(){
114 114
         
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     /**
119 119
      * Article category
120 120
      * 
121
-     * @return object
121
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
122 122
      */
123 123
     public function articlecategories(){
124 124
         
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     /**
129 129
      * Article category
130 130
      * 
131
-     * @return object
131
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
132 132
      */
133 133
     public function pages(){
134 134
         
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,30 +32,30 @@  discard block
 block discarded – undo
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', 'alt', 'url', 'image', 
42
+    protected $fillable = [ 'name', 'description', 'alt', 'url', 'image', 
43 43
         'imagecategory_id', 'image_mime_type', 'image_extension', 
44
-        'image_original_name', 'image_size', 'image_width', 'image_height'];
44
+        'image_original_name', 'image_size', 'image_width', 'image_height' ];
45 45
     
46 46
     /**
47 47
      * Columns to exclude from index
48 48
      * 
49 49
      * @var array 
50 50
      */
51
-    protected $excludedFromIndex = ['image'];
51
+    protected $excludedFromIndex = [ 'image' ];
52 52
     
53 53
     /**
54 54
      * Hidden from custom find
55 55
      * 
56 56
      * @var arrat 
57 57
      */
58
-    protected  $excludedFromFind = ['image'];
58
+    protected  $excludedFromFind = [ 'image' ];
59 59
     
60 60
     /**
61 61
      * Fields to search in fulltext mode
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * 
101 101
      * @return object
102 102
      */
103
-    public function imagecategories(){
103
+    public function imagecategories() {
104 104
         
105 105
         return $this->belongsTo('App\ImageCategory', 'imagecategory_id');
106 106
     }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * 
111 111
      * @return object
112 112
      */
113
-    public function slides(){
113
+    public function slides() {
114 114
         
115 115
         return $this->hasMany('App\Slide', 'image_id');
116 116
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      * 
121 121
      * @return object
122 122
      */
123
-    public function articlecategories(){
123
+    public function articlecategories() {
124 124
         
125 125
         return $this->hasMany('App\ArticleCategory', 'image_id');
126 126
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      * 
131 131
      * @return object
132 132
      */
133
-    public function pages(){
133
+    public function pages() {
134 134
         
135 135
         return $this->hasMany('App\Page', 'image_id');
136 136
     }
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      * @param query $query
142 142
      * @return query
143 143
      */
144
-    public function scopeRelationships($query){
144
+    public function scopeRelationships($query) {
145 145
         
146 146
         return $query->with('imagecategories');
147 147
     }
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
      * 
152 152
      * @param array $array
153 153
      */
154
-    public function hide($array = []){
154
+    public function hide($array = [ ]) {
155 155
         
156
-        $this->hidden = ['image'];
156
+        $this->hidden = [ 'image' ];
157 157
     }
158 158
 }
Please login to merge, or discard this patch.
app/ImageCategory.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
     /**
81 81
      * Image link
82 82
      * 
83
-     * @return object
83
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
84 84
      */
85 85
     public function images(){
86 86
         
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,21 +33,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
82 82
      * 
83 83
      * @return object
84 84
      */
85
-    public function images(){
85
+    public function images() {
86 86
         
87 87
         return $this->hasMany('App\Image', 'imagecategory_id');
88 88
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      * @param query $query@
94 94
      * @return query
95 95
      */
96
-    public function scopeRelationships($query){
96
+    public function scopeRelationships($query) {
97 97
         
98 98
         return $query->with('images');
99 99
     }
Please login to merge, or discard this patch.
app/CommentStatus.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,21 +33,21 @@  discard block
 block discarded – undo
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', 'color'];
43
+    protected $fillable = [ 'name', '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
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * 
79 79
      * @return object
80 80
      */
81
-    public function comments(){
81
+    public function comments() {
82 82
         
83 83
         return $this->hasMany('App\Comment', 'commentstatus_id');
84 84
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * @param query $query
90 90
      * @return query
91 91
      */
92
-    public function scopeRelationships($query){
92
+    public function scopeRelationships($query) {
93 93
         
94 94
         return $query->with('comments');
95 95
     }
Please login to merge, or discard this patch.
app/Comment.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,22 +33,22 @@  discard block
 block discarded – undo
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', 'headline', 'text', 'email', 
44
-        'url', 'approved', 'commentstatus_id', 'page_id', 'article_id'];
43
+    protected $fillable = [ 'name', 'headline', 'text', 'email', 
44
+        'url', 'approved', 'commentstatus_id', 'page_id', 'article_id' ];
45 45
     
46 46
     /**
47 47
      * Columns to exclude from index
48 48
      * 
49 49
      * @var array 
50 50
      */
51
-    protected $excludedFromIndex = [];
51
+    protected $excludedFromIndex = [ ];
52 52
 
53 53
     /**
54 54
      * Fields to search in fulltext mode
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * 
90 90
      * @return object
91 91
      */
92
-    public function commentstatuses(){
92
+    public function commentstatuses() {
93 93
         
94 94
          return $this->belongsTo('App\CommentStatus', 'commentstatus_id');
95 95
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      * 
100 100
      * @return object
101 101
      */
102
-    public function articles(){
102
+    public function articles() {
103 103
         
104 104
         return $this->belongsTo('App\Article', 'article_id');
105 105
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * 
110 110
      * @return object
111 111
      */
112
-    public function pages(){
112
+    public function pages() {
113 113
         
114 114
          return $this->belongsTo('App\Page', 'page_id');
115 115
     }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      * @param query $query
121 121
      * @return query
122 122
      */
123
-    public function scopeRelationships($query){
123
+    public function scopeRelationships($query) {
124 124
         
125 125
         return $query->with('articles', 'pages', 'commentstatuses');
126 126
     }
Please login to merge, or discard this patch.