Completed
Push — master ( be44c5...20f323 )
by Jan
07:43
created
app/Http/Controllers/Admin/ArticleCategoryController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         /**
31 31
          * Other tables
32 32
          */
33
-        $this->middleware('media.image.select:Image', ['only' => ['create', 'edit']]);
33
+        $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]);
34 34
     }
35 35
 
36 36
     /**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         'meta_keywords' => 'max:255',
46 46
         'url' => 'required|max:255|unique:articlecategory,url',
47 47
         'text' => 'max:1000000',
48
-        'color' => 'required|max:255'];
48
+        'color' => 'required|max:255' ];
49 49
     
50 50
     /**
51 51
      * Associate relationships to other table
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdvertController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
         /**
31 31
          * Add lookup tables
32 32
          */
33
-        $this->middleware('add.lookup.tables:AdvertLocation', ['only' => ['create', 'edit']]);
33
+        $this->middleware('add.lookup.tables:AdvertLocation', [ 'only' => [ 'create', 'edit' ] ]);
34 34
 
35 35
         /**
36 36
          * Other tables
37 37
          */
38
-        $this->middleware('media.image.select:Image', ['only' => ['create', 'edit']]);
38
+        $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]);
39 39
     }
40 40
 
41 41
     /**
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
         /**
96 96
          * Validate advert location ID, if failed set to default
97 97
          */
98
-        if($request->has('advertlocation_id')){
98
+        if ($request->has('advertlocation_id')) {
99 99
             
100
-            $validIDs = [];
100
+            $validIDs = [ ];
101 101
 
102 102
             foreach ($request->input('advertlocation_id') as $advertlocation_id) {
103 103
 
104
-                $arrayForValidator = ['advertlocation_id' =>  $advertlocation_id];
104
+                $arrayForValidator = [ 'advertlocation_id' =>  $advertlocation_id ];
105 105
 
106 106
                 $validator = Validator::make($arrayForValidator, [
107 107
                             'advertlocation_id' => 'required|integer|min:1|exists:advertlocation,id',
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                  */
120 120
                 else {
121 121
 
122
-                    $validIDs[] = $advertlocation_id;
122
+                    $validIDs[ ] = $advertlocation_id;
123 123
                 }
124 124
             }
125 125
             
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/PasswordController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,25 +31,25 @@
 block discarded – undo
31 31
         $this->middleware('guest');
32 32
     }
33 33
     
34
-    public function prePostEmail(Request $request){
34
+    public function prePostEmail(Request $request) {
35 35
         
36 36
         /**
37 37
          * Add recaptcha
38 38
          */
39
-        if(env('RECAPTCHA_ENABLED') == 1){
40
-            $this->validate($request, ['g-recaptcha-response' => 'required|recaptcha']);
39
+        if (env('RECAPTCHA_ENABLED') == 1) {
40
+            $this->validate($request, [ 'g-recaptcha-response' => 'required|recaptcha' ]);
41 41
         }
42 42
         
43 43
         return $this->postEmail($request);
44 44
     }
45 45
     
46
-    public function prePostReset(Request $request){
46
+    public function prePostReset(Request $request) {
47 47
         
48 48
         /**
49 49
          * Add recaptcha
50 50
          */
51
-        if(env('RECAPTCHA_ENABLED') == 1){
52
-            $this->validate($request, ['g-recaptcha-response' => 'required|recaptcha']);
51
+        if (env('RECAPTCHA_ENABLED') == 1) {
52
+            $this->validate($request, [ 'g-recaptcha-response' => 'required|recaptcha' ]);
53 53
         }
54 54
         
55 55
         return $this->postReset($request);
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/AuthController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public function __construct()
40 40
     {
41 41
         $this->redirectAfterLogout = env('APP_ADMIN_URL', 'admin');
42
-        $this->middleware('guest', ['except' => 'getLogout']);
42
+        $this->middleware('guest', [ 'except' => 'getLogout' ]);
43 43
     }
44 44
 
45 45
     /**
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     protected function create(array $data)
67 67
     {
68 68
         return User::create([
69
-            'name' => $data['name'],
70
-            'email' => $data['email'],
71
-            'password' => bcrypt($data['password']),
69
+            'name' => $data[ 'name' ],
70
+            'email' => $data[ 'email' ],
71
+            'password' => bcrypt($data[ 'password' ]),
72 72
         ]);
73 73
     }
74 74
     
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
         /**
78 78
          * Add recaptcha
79 79
          */
80
-        if(env('RECAPTCHA_ENABLED') == 1){
81
-            $this->validate($request, ['g-recaptcha-response' => 'required|recaptcha']);
80
+        if (env('RECAPTCHA_ENABLED') == 1) {
81
+            $this->validate($request, [ 'g-recaptcha-response' => 'required|recaptcha' ]);
82 82
         }
83 83
         
84 84
         return $this->postLogin($request);
Please login to merge, or discard this patch.
app/Http/routesCustom-example.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 /**
16 16
  * Frontend root
17 17
  */
18
-Route::get('/', ['as' => 'root', function () {
18
+Route::get('/', [ 'as' => 'root', function() {
19 19
         return view('welcome');
20
-}]);
20
+} ]);
Please login to merge, or discard this patch.
app/Http/Middleware/AddPublishedAt.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
     public function handle($request, Closure $next)
29 29
     {
30 30
  
31
-        if($request->has('published')){
31
+        if ($request->has('published')) {
32 32
             
33
-            $request->merge(['published_at' => \Carbon\Carbon::now()]);
33
+            $request->merge([ 'published_at' => \Carbon\Carbon::now() ]);
34 34
         }
35
-        else{
35
+        else {
36 36
 
37
-            $request->merge(['published_at' => NULL]);
37
+            $request->merge([ 'published_at' => NULL ]);
38 38
         }
39 39
         
40 40
         return $next($request);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Http/Middleware/AddLookupTables.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
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);     
Please login to merge, or discard this patch.
app/Http/routes.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,8 +153,8 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
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
  * Admin
24 24
  */
25
-Route::group(['prefix' => env('APP_ADMIN_URL', 'admin'), 'as' => 'admin.', 'middleware' => 'auth'], function () {
25
+Route::group([ 'prefix' => env('APP_ADMIN_URL', 'admin'), 'as' => 'admin.', 'middleware' => 'auth' ], function() {
26 26
     
27 27
     /**
28 28
      * Main dashboard
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * Articles and categories
36 36
      */
37
-    Route::resource('page', 'Admin\PageController', ['names' => [
37
+    Route::resource('page', 'Admin\PageController', [ 'names' => [
38 38
         'index' => 'page.index',
39 39
         'create' => 'page.create',
40 40
         'store' => 'page.store',
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
         'edit' => 'page.edit',
43 43
         'update' => 'page.update',
44 44
         'destroy' => 'page.destroy'
45
-        ]]);
46
-    Route::resource('pageCategory', 'Admin\PageCategoryController', ['names' => [
45
+        ] ]);
46
+    Route::resource('pageCategory', 'Admin\PageCategoryController', [ 'names' => [
47 47
         'index' => 'pageCategory.index',
48 48
         'create' => 'pageCategory.create',
49 49
         'store' => 'pageCategory.store',
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
         'edit' => 'pageCategory.edit',
52 52
         'update' => 'pageCategory.update',
53 53
         'destroy' => 'pageCategory.destroy'
54
-        ]]);
54
+        ] ]);
55 55
     
56 56
     /**
57 57
      * Articles and categories
58 58
      */
59
-    Route::resource('article', 'Admin\ArticleController', ['names' => [
59
+    Route::resource('article', 'Admin\ArticleController', [ 'names' => [
60 60
         'index' => 'article.index',
61 61
         'create' => 'article.create',
62 62
         'store' => 'article.store',
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
         'edit' => 'article.edit',
65 65
         'update' => 'article.update',
66 66
         'destroy' => 'article.destroy'
67
-        ]]);
68
-    Route::resource('articleCategory', 'Admin\ArticleCategoryController', ['names' => [
67
+        ] ]);
68
+    Route::resource('articleCategory', 'Admin\ArticleCategoryController', [ 'names' => [
69 69
         'index' => 'articleCategory.index',
70 70
         'create' => 'articleCategory.create',
71 71
         'store' => 'articleCategory.store',
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
         'edit' => 'articleCategory.edit',
74 74
         'update' => 'articleCategory.update',
75 75
         'destroy' => 'articleCategory.destroy'
76
-        ]]);
76
+        ] ]);
77 77
     
78 78
     /**
79 79
      * Feedback
80 80
      */
81
-    Route::resource('feedback', 'Admin\FeedbackController', ['names' => [
81
+    Route::resource('feedback', 'Admin\FeedbackController', [ 'names' => [
82 82
         'index' => 'feedback.index',
83 83
         'create' => 'feedback.create',
84 84
         'store' => 'feedback.store',
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
         'edit' => 'feedback.edit',
87 87
         'update' => 'feedback.update',
88 88
         'destroy' => 'feedback.destroy'
89
-        ]]);
89
+        ] ]);
90 90
     
91 91
     /**
92 92
      * Comment
93 93
      */
94
-    Route::resource('comment', 'Admin\CommentController', ['names' => [
94
+    Route::resource('comment', 'Admin\CommentController', [ 'names' => [
95 95
         'index' => 'comment.index',
96 96
         'create' => 'comment.create',
97 97
         'store' => 'comment.store',
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         'edit' => 'comment.edit',
100 100
         'update' => 'comment.update',
101 101
         'destroy' => 'comment.destroy'
102
-        ]]);
102
+        ] ]);
103 103
     Route::get('comment/{id}/approve', [
104 104
         'as' => 'comment.approve', 'uses' => 'Admin\CommentController@approve'
105 105
     ]);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     /**
111 111
      * Sliders and slides
112 112
      */
113
-    Route::resource('slider', 'Admin\SliderController', ['names' => [
113
+    Route::resource('slider', 'Admin\SliderController', [ 'names' => [
114 114
         'index' => 'slider.index',
115 115
         'create' => 'slider.create',
116 116
         'store' => 'slider.store',
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
         'edit' => 'slider.edit',
119 119
         'update' => 'slider.update',
120 120
         'destroy' => 'slider.destroy'
121
-        ]]);
122
-    Route::resource('slide', 'Admin\SlideController', ['names' => [
121
+        ] ]);
122
+    Route::resource('slide', 'Admin\SlideController', [ 'names' => [
123 123
         'index' => 'slide.index',
124 124
         'create' => 'slide.create',
125 125
         'store' => 'slide.store',
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
         'edit' => 'slide.edit',
128 128
         'update' => 'slide.update',
129 129
         'destroy' => 'slide.destroy'
130
-        ]]);
130
+        ] ]);
131 131
     
132 132
     /**
133 133
      * Images and categories
134 134
      */
135
-    Route::resource('image', 'Admin\ImageController', ['middleware' => ['media.addparameters'],
135
+    Route::resource('image', 'Admin\ImageController', [ 'middleware' => [ 'media.addparameters' ],
136 136
         'names' => [
137 137
         'index' => 'image.index',
138 138
         'create' => 'image.create',
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
         'edit' => 'image.edit',
142 142
         'update' => 'image.update',
143 143
         'destroy' => 'image.destroy'
144
-        ]]);
145
-    Route::resource('imageCategory', 'Admin\ImageCategoryController', ['names' => [
144
+        ] ]);
145
+    Route::resource('imageCategory', 'Admin\ImageCategoryController', [ 'names' => [
146 146
         'index' => 'imageCategory.index',
147 147
         'create' => 'imageCategory.create',
148 148
         'store' => 'imageCategory.store',
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
         'edit' => 'imageCategory.edit',
151 151
         'update' => 'imageCategory.update',
152 152
         'destroy' => 'imageCategory.destroy'
153
-        ]]);
153
+        ] ]);
154 154
     
155 155
      /**
156 156
      * Advertising
157 157
      */
158
-    Route::resource('advert', 'Admin\AdvertController', ['names' => [
158
+    Route::resource('advert', 'Admin\AdvertController', [ 'names' => [
159 159
         'index' => 'advert.index',
160 160
         'create' => 'advert.create',
161 161
         'store' => 'advert.store',
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         'edit' => 'advert.edit',
164 164
         'update' => 'advert.update',
165 165
         'destroy' => 'advert.destroy'
166
-        ]]);
167
-    Route::resource('advertLocation', 'Admin\AdvertLocationController', ['names' => [
166
+        ] ]);
167
+    Route::resource('advertLocation', 'Admin\AdvertLocationController', [ 'names' => [
168 168
         'index' => 'advertLocation.index',
169 169
         'create' => 'advertLocation.create',
170 170
         'store' => 'advertLocation.store',
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
         'edit' => 'advertLocation.edit',
173 173
         'update' => 'advertLocation.update',
174 174
         'destroy' => 'advertLocation.destroy'
175
-        ]]);
175
+        ] ]);
176 176
     
177 177
     /**
178 178
      * Products and categories
179 179
      */
180
-    Route::resource('productCategory', 'Admin\ProductCategoryController', ['names' => [
180
+    Route::resource('productCategory', 'Admin\ProductCategoryController', [ 'names' => [
181 181
         'index' => 'productCategory.index',
182 182
         'create' => 'productCategory.create',
183 183
         'store' => 'productCategory.store',
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
         'edit' => 'productCategory.edit',
186 186
         'update' => 'productCategory.update',
187 187
         'destroy' => 'productCategory.destroy'
188
-        ]]);
189
-    Route::resource('product', 'Admin\ProductController', ['names' => [
188
+        ] ]);
189
+    Route::resource('product', 'Admin\ProductController', [ 'names' => [
190 190
         'index' => 'product.index',
191 191
         'create' => 'product.create',
192 192
         'store' => 'product.store',
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
         'edit' => 'product.edit',
195 195
         'update' => 'product.update',
196 196
         'destroy' => 'product.destroy'
197
-        ]]);
197
+        ] ]);
198 198
     
199 199
     /**
200 200
      * Settings
201 201
      */
202 202
     Route::resource('settings', 'Admin\SettingsController', [
203
-        'except' => ['delete', 'show'],
203
+        'except' => [ 'delete', 'show' ],
204 204
         'names' => [
205 205
         'index' => 'settings.index',
206 206
         'create' => 'settings.create',
@@ -209,13 +209,13 @@  discard block
 block discarded – undo
209 209
         'edit' => 'settings.edit',
210 210
         'update' => 'settings.update',
211 211
         'destroy' => 'settings.destroy'
212
-        ]]);
212
+        ] ]);
213 213
     
214 214
     /**
215 215
      * Users
216 216
      */
217 217
     Route::resource('user', 'Admin\UserController', [
218
-        'except' => ['show'],
218
+        'except' => [ 'show' ],
219 219
         'names' => [
220 220
         'index' => 'user.index',
221 221
         'create' => 'user.create',
@@ -224,14 +224,14 @@  discard block
 block discarded – undo
224 224
         'edit' => 'user.edit',
225 225
         'update' => 'user.update',
226 226
         'destroy' => 'user.destroy'
227
-        ]]);
227
+        ] ]);
228 228
     
229 229
 });
230 230
 
231 231
 /**
232 232
  * Authentication
233 233
  */
234
-Route::group(['prefix' => 'auth'], function () {
234
+Route::group([ 'prefix' => 'auth' ], function() {
235 235
     
236 236
     Route::get('login', [
237 237
         'as' => 'authGetLogin', 'uses' => 'Auth\AuthController@getLogin'
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 /**
260 260
  * Images
261 261
  */
262
-Route::get('/' . env('APP_IMAGE_URL', 'images').'/{imageName}.{imageExtension}', [
262
+Route::get('/' . env('APP_IMAGE_URL', 'images') . '/{imageName}.{imageExtension}', [
263 263
     'as' => 'getImage', 'uses' => 'Media\ImageController@getImage'
264 264
 ]);
265 265
 
Please login to merge, or discard this patch.
app/AdvertLocation.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', '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 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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.