@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function __construct() { |
28 | 28 | parent::__construct(); |
29 | 29 | |
30 | - $this->middleware('add.lookup.tables:ImageCategory', ['only' => ['index','create','edit']]); |
|
30 | + $this->middleware('add.lookup.tables:ImageCategory', [ 'only' => [ 'index', 'create', 'edit' ] ]); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @var array |
47 | 47 | */ |
48 | - protected $binaryFields = []; |
|
48 | + protected $binaryFields = [ ]; |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Get number of pagination rows |
52 | 52 | * |
53 | 53 | * @return integer |
54 | 54 | */ |
55 | - public function getRowsToPaginate(){ |
|
55 | + public function getRowsToPaginate() { |
|
56 | 56 | |
57 | 57 | return env('ADMIN_MEDIA_PAGINATE', 12); |
58 | 58 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param object $object |
64 | 64 | * @param Request $request |
65 | 65 | */ |
66 | - public function associateRelationships($object, Request $request){ |
|
66 | + public function associateRelationships($object, Request $request) { |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Validate category ID, if failed set to default |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * Validator OK - save it |
85 | 85 | */ |
86 | - else{ |
|
86 | + else { |
|
87 | 87 | |
88 | 88 | $object->imagecategories()->associate($request->input('imagecategory_id')); |
89 | 89 | } |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Image has an url |
109 | 109 | */ |
110 | - if(strlen($request->input('url') > 5)){ |
|
110 | + if (strlen($request->input('url') > 5)) { |
|
111 | 111 | $object->addMedia($request->file('image'))->toMediaCollection('images') |
112 | 112 | ->usingName($request->input('url')); |
113 | 113 | } |
114 | - else{ |
|
114 | + else { |
|
115 | 115 | $object->addMedia($request->file('image'))->toMediaCollection('images'); |
116 | 116 | } |
117 | 117 |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Get META information |
42 | 42 | */ |
43 | - $imageMeta = Image::where(['url' => $request->imageName])->first(); |
|
43 | + $imageMeta = Image::where([ 'url' => $request->imageName ])->first(); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * File does not exist |
47 | 47 | */ |
48 | - if(empty($imageMeta) == TRUE){ |
|
48 | + if (empty($imageMeta) == TRUE) { |
|
49 | 49 | App::abort(404); |
50 | 50 | } |
51 | 51 | |
52 | 52 | $mediaItems = $imageMeta->getMedia(); |
53 | - $fullPathOnDisk = $mediaItems[0]->getPath(); |
|
53 | + $fullPathOnDisk = $mediaItems[ 0 ]->getPath(); |
|
54 | 54 | |
55 | 55 | |
56 | 56 | /** |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | 'Content-Description' => 'File Transfer', |
67 | 67 | 'Content-Transfer-Encoding' => 'binary', |
68 | 68 | 'Pragma' => 'public', |
69 | - 'Expires' => Carbon::createFromTimestamp(time()+3600)->toRfc2822String(), |
|
69 | + 'Expires' => Carbon::createFromTimestamp(time() + 3600)->toRfc2822String(), |
|
70 | 70 | 'Last-Modified' => $imageMeta->updated_at->toRfc2822String() |
71 | 71 | ); |
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Response code cached |
75 | 75 | */ |
76 | - if( (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $imageMeta->image_etag) |
|
77 | - || (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $imageMeta->updated_at->toRfc2822String()) ){ |
|
76 | + if ((isset($_SERVER[ 'HTTP_IF_NONE_MATCH' ]) && $_SERVER[ 'HTTP_IF_NONE_MATCH' ] == $imageMeta->image_etag) |
|
77 | + || (isset($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ]) && $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ] == $imageMeta->updated_at->toRfc2822String())) { |
|
78 | 78 | |
79 | 79 | $responseCode = 304; |
80 | 80 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Response code not cached, but OK |
84 | 84 | */ |
85 | - else{ |
|
85 | + else { |
|
86 | 86 | |
87 | 87 | $responseCode = 200; |
88 | 88 | } |
@@ -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', ['names' => [ |
|
144 | + Route::resource('image', 'Admin\ImageController', [ 'names' => [ |
|
145 | 145 | 'index' => 'image.index', |
146 | 146 | 'create' => 'image.create', |
147 | 147 | 'store' => 'image.store', |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | 'edit' => 'image.edit', |
150 | 150 | 'update' => 'image.update', |
151 | 151 | 'destroy' => 'image.destroy' |
152 | - ]]); |
|
153 | - Route::resource('imageCategory', 'Admin\ImageCategoryController', ['names' => [ |
|
152 | + ] ]); |
|
153 | + Route::resource('imageCategory', 'Admin\ImageCategoryController', [ 'names' => [ |
|
154 | 154 | 'index' => 'imageCategory.index', |
155 | 155 | 'create' => 'imageCategory.create', |
156 | 156 | 'store' => 'imageCategory.store', |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | 'edit' => 'imageCategory.edit', |
159 | 159 | 'update' => 'imageCategory.update', |
160 | 160 | 'destroy' => 'imageCategory.destroy' |
161 | - ]]); |
|
161 | + ] ]); |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Advertising |
165 | 165 | */ |
166 | - Route::resource('advert', 'Admin\AdvertController', ['names' => [ |
|
166 | + Route::resource('advert', 'Admin\AdvertController', [ 'names' => [ |
|
167 | 167 | 'index' => 'advert.index', |
168 | 168 | 'create' => 'advert.create', |
169 | 169 | 'store' => 'advert.store', |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | 'edit' => 'advert.edit', |
172 | 172 | 'update' => 'advert.update', |
173 | 173 | 'destroy' => 'advert.destroy' |
174 | - ]]); |
|
175 | - Route::resource('advertLocation', 'Admin\AdvertLocationController', ['names' => [ |
|
174 | + ] ]); |
|
175 | + Route::resource('advertLocation', 'Admin\AdvertLocationController', [ 'names' => [ |
|
176 | 176 | 'index' => 'advertLocation.index', |
177 | 177 | 'create' => 'advertLocation.create', |
178 | 178 | 'store' => 'advertLocation.store', |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | 'edit' => 'advertLocation.edit', |
181 | 181 | 'update' => 'advertLocation.update', |
182 | 182 | 'destroy' => 'advertLocation.destroy' |
183 | - ]]); |
|
183 | + ] ]); |
|
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Products and categories |
187 | 187 | */ |
188 | - Route::resource('productCategory', 'Admin\ProductCategoryController', ['names' => [ |
|
188 | + Route::resource('productCategory', 'Admin\ProductCategoryController', [ 'names' => [ |
|
189 | 189 | 'index' => 'productCategory.index', |
190 | 190 | 'create' => 'productCategory.create', |
191 | 191 | 'store' => 'productCategory.store', |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | 'edit' => 'productCategory.edit', |
194 | 194 | 'update' => 'productCategory.update', |
195 | 195 | 'destroy' => 'productCategory.destroy' |
196 | - ]]); |
|
197 | - Route::resource('product', 'Admin\ProductController', ['names' => [ |
|
196 | + ] ]); |
|
197 | + Route::resource('product', 'Admin\ProductController', [ 'names' => [ |
|
198 | 198 | 'index' => 'product.index', |
199 | 199 | 'create' => 'product.create', |
200 | 200 | 'store' => 'product.store', |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | 'edit' => 'product.edit', |
203 | 203 | 'update' => 'product.update', |
204 | 204 | 'destroy' => 'product.destroy' |
205 | - ]]); |
|
205 | + ] ]); |
|
206 | 206 | |
207 | 207 | /** |
208 | 208 | * Settings |
209 | 209 | */ |
210 | 210 | Route::resource('settings', 'Admin\SettingsController', [ |
211 | - 'except' => ['delete', 'show'], |
|
211 | + 'except' => [ 'delete', 'show' ], |
|
212 | 212 | 'names' => [ |
213 | 213 | 'index' => 'settings.index', |
214 | 214 | 'create' => 'settings.create', |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | 'edit' => 'settings.edit', |
218 | 218 | 'update' => 'settings.update', |
219 | 219 | 'destroy' => 'settings.destroy' |
220 | - ]]); |
|
220 | + ] ]); |
|
221 | 221 | |
222 | 222 | /** |
223 | 223 | * Users |
224 | 224 | */ |
225 | 225 | Route::resource('user', 'Admin\UserController', [ |
226 | - 'except' => ['show'], |
|
226 | + 'except' => [ 'show' ], |
|
227 | 227 | 'names' => [ |
228 | 228 | 'index' => 'user.index', |
229 | 229 | 'create' => 'user.create', |
@@ -232,14 +232,14 @@ discard block |
||
232 | 232 | 'edit' => 'user.edit', |
233 | 233 | 'update' => 'user.update', |
234 | 234 | 'destroy' => 'user.destroy' |
235 | - ]]); |
|
235 | + ] ]); |
|
236 | 236 | |
237 | 237 | }); |
238 | 238 | |
239 | 239 | /** |
240 | 240 | * Authentication |
241 | 241 | */ |
242 | -Route::group(['middleware' => 'web'], function () { |
|
242 | +Route::group([ 'middleware' => 'web' ], function() { |
|
243 | 243 | |
244 | 244 | Route::get('login', 'Auth\LoginController@showLoginForm')->name('login'); |
245 | 245 | Route::post('login', 'Auth\LoginController@login')->name('authPostLogin'); |
@@ -15,6 +15,6 @@ |
||
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 | +} ]); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | * @param $name |
28 | 28 | * @return |null |
29 | 29 | */ |
30 | - public static function getByName($name){ |
|
30 | + public static function getByName($name) { |
|
31 | 31 | $result = self::where('name', $name)->first(); |
32 | - if(!empty($result)){ |
|
32 | + if (!empty($result)) { |
|
33 | 33 | return $result->value; |
34 | 34 | } |
35 | - else{ |
|
35 | + else { |
|
36 | 36 | return null; |
37 | 37 | } |
38 | 38 | } |
@@ -50,21 +50,21 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
53 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * The attributes that are mass assignable. |
57 | 57 | * |
58 | 58 | * @var array |
59 | 59 | */ |
60 | - protected $fillable = ['name', 'value', 'description']; |
|
60 | + protected $fillable = [ 'name', 'value', 'description' ]; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Columns to exclude from index |
64 | 64 | * |
65 | 65 | * @var array |
66 | 66 | */ |
67 | - protected $excludedFromIndex = []; |
|
67 | + protected $excludedFromIndex = [ ]; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Fields to search in fulltext mode |
@@ -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 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * |
154 | 154 | * @param $request |
155 | 155 | */ |
156 | - protected function afterStore($request, $model){ |
|
156 | + protected function afterStore($request, $model) { |
|
157 | 157 | |
158 | 158 | } |
159 | 159 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @param $request |
164 | 164 | */ |
165 | - protected function afterUpdate($request, $model){ |
|
165 | + protected function afterUpdate($request, $model) { |
|
166 | 166 | |
167 | 167 | } |
168 | 168 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @param $amount |
176 | 176 | */ |
177 | 177 | protected function _saveTransation($status_id = 1, $user_id, $amount, |
178 | - $campaign_id = null, $payment_id = null, $recommendation_id = null){ |
|
178 | + $campaign_id = null, $payment_id = null, $recommendation_id = null) { |
|
179 | 179 | |
180 | 180 | /** |
181 | 181 | * Save transaction |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param boolean $update |
206 | 206 | * @return boolean |
207 | 207 | */ |
208 | - public function saveMediaToStorage($object, $request, $update = FALSE){ |
|
208 | + public function saveMediaToStorage($object, $request, $update = FALSE) { |
|
209 | 209 | |
210 | 210 | return FALSE; |
211 | 211 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | return env('ADMIN_PAGINATE', 10); |
223 | 223 | } |
224 | - else{ |
|
224 | + else { |
|
225 | 225 | |
226 | 226 | return $this->paginateRows; |
227 | 227 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param object $object |
234 | 234 | * @param Request $request |
235 | 235 | */ |
236 | - public function associateRelationships($object, Request $request){ |
|
236 | + public function associateRelationships($object, Request $request) { |
|
237 | 237 | |
238 | 238 | } |
239 | 239 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param object $object |
244 | 244 | * @param Request $request |
245 | 245 | */ |
246 | - public function associateRelationshipsWithID($object, Request $request){ |
|
246 | + public function associateRelationshipsWithID($object, Request $request) { |
|
247 | 247 | |
248 | 248 | } |
249 | 249 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * |
253 | 253 | * @param object $object |
254 | 254 | */ |
255 | - public function resetCache($object){ |
|
255 | + public function resetCache($object) { |
|
256 | 256 | |
257 | 257 | } |
258 | 258 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @param $arResult |
263 | 263 | * @return mixed |
264 | 264 | */ |
265 | - public function changeEditResultField($arResult){ |
|
265 | + public function changeEditResultField($arResult) { |
|
266 | 266 | return $arResult; |
267 | 267 | } |
268 | 268 | |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Get media |
299 | 299 | */ |
300 | - if(method_exists($arResults, 'getMedia')){ |
|
300 | + if (method_exists($arResults, 'getMedia')) { |
|
301 | 301 | $media = $arResults->getMedia(); |
302 | 302 | } |
303 | - else{ |
|
303 | + else { |
|
304 | 304 | $media = null; |
305 | 305 | } |
306 | 306 | |
@@ -308,17 +308,17 @@ discard block |
||
308 | 308 | /** |
309 | 309 | * Choose the view |
310 | 310 | */ |
311 | - if(empty($this->customView['index']) == TRUE){ |
|
311 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
312 | 312 | $view = $this->moduleBasicTemplatePath . '.index'; |
313 | 313 | } |
314 | - else{ |
|
314 | + else { |
|
315 | 315 | $view = $this->customView; |
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
319 | 319 | * Return page |
320 | 320 | */ |
321 | - return view($view, ['results' => $arResults, 'media' => $media]); |
|
321 | + return view($view, [ 'results' => $arResults, 'media' => $media ]); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -331,10 +331,10 @@ discard block |
||
331 | 331 | /** |
332 | 332 | * Choose the view |
333 | 333 | */ |
334 | - if(empty($this->customView['index']) == TRUE){ |
|
334 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
335 | 335 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
336 | 336 | } |
337 | - else{ |
|
337 | + else { |
|
338 | 338 | $view = $this->customView; |
339 | 339 | } |
340 | 340 | |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | * Change the validation array |
357 | 357 | */ |
358 | 358 | foreach ($this->arValidationArray as $name => $value) { |
359 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
360 | - $this->arValidationArray[$name] = $value . ',NULL,id,deleted_at,NULL'; |
|
359 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
360 | + $this->arValidationArray[ $name ] = $value . ',NULL,id,deleted_at,NULL'; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
@@ -380,16 +380,16 @@ discard block |
||
380 | 380 | /** |
381 | 381 | * Datetime |
382 | 382 | */ |
383 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
383 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
384 | 384 | |
385 | - $object->{$name} = str_replace('T', ' ', $request->input($name)). ':00'; |
|
385 | + $object->{$name} = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
386 | 386 | } |
387 | 387 | else { |
388 | 388 | |
389 | 389 | /** |
390 | 390 | * Change to null if needed |
391 | 391 | */ |
392 | - if(strlen($request->$name) < 1){ |
|
392 | + if (strlen($request->$name) < 1) { |
|
393 | 393 | $object->{$name} = null; |
394 | 394 | } |
395 | 395 | else { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | /** |
429 | 429 | * Redirect to index |
430 | 430 | */ |
431 | - if(!empty($request->custom_route)){ |
|
431 | + if (!empty($request->custom_route)) { |
|
432 | 432 | return redirect($request->custom_route); |
433 | 433 | } |
434 | 434 | else { |
@@ -457,21 +457,21 @@ discard block |
||
457 | 457 | */ |
458 | 458 | if (empty($arResults)) { |
459 | 459 | |
460 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
460 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
464 | 464 | * Set the put method for update |
465 | 465 | */ |
466 | - $arResults['_method'] = 'PUT'; |
|
466 | + $arResults[ '_method' ] = 'PUT'; |
|
467 | 467 | |
468 | 468 | /** |
469 | 469 | * Choose the view |
470 | 470 | */ |
471 | - if(empty($this->customView['index']) == TRUE){ |
|
471 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
472 | 472 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
473 | 473 | } |
474 | - else{ |
|
474 | + else { |
|
475 | 475 | $view = $this->customView; |
476 | 476 | } |
477 | 477 | |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | /** |
481 | 481 | * Return page |
482 | 482 | */ |
483 | - return view($view, ['results' => $arResults]); |
|
483 | + return view($view, [ 'results' => $arResults ]); |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | /** |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | */ |
509 | 509 | foreach ($this->arValidationArray as $name => $value) { |
510 | 510 | |
511 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
512 | - $this->arValidationArray[$name] = $value . ','.$id.',id,deleted_at,NULL'; |
|
511 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
512 | + $this->arValidationArray[ $name ] = $value . ',' . $id . ',id,deleted_at,NULL'; |
|
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | */ |
530 | 530 | if ($arResults == FALSE) { |
531 | 531 | |
532 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
532 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | /** |
@@ -546,10 +546,10 @@ discard block |
||
546 | 546 | * Binary fields will not be updated if empty |
547 | 547 | * |
548 | 548 | */ |
549 | - if(in_array($name, $this->binaryFields)){ |
|
549 | + if (in_array($name, $this->binaryFields)) { |
|
550 | 550 | |
551 | 551 | } |
552 | - else{ |
|
552 | + else { |
|
553 | 553 | |
554 | 554 | /** |
555 | 555 | * Empty exception |
@@ -559,26 +559,26 @@ discard block |
||
559 | 559 | /** |
560 | 560 | * Datetime |
561 | 561 | */ |
562 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
562 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
563 | 563 | |
564 | - $arResults->$name = str_replace('T', ' ', $request->input($name)). ':00'; |
|
564 | + $arResults->$name = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
565 | 565 | } |
566 | 566 | else { |
567 | 567 | $arResults->$name = $request->input($name); |
568 | 568 | } |
569 | 569 | } |
570 | 570 | |
571 | - else{ |
|
571 | + else { |
|
572 | 572 | |
573 | 573 | /** |
574 | 574 | * Numeric zero ? |
575 | 575 | */ |
576 | - if(isset($request->$name) && is_numeric($request->input($name)) == TRUE){ |
|
576 | + if (isset($request->$name) && is_numeric($request->input($name)) == TRUE) { |
|
577 | 577 | |
578 | 578 | $arResults->$name = $request->input($name); |
579 | 579 | } |
580 | 580 | |
581 | - else{ |
|
581 | + else { |
|
582 | 582 | $arResults->$name = NULL; |
583 | 583 | } |
584 | 584 | } |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | /** |
597 | 597 | * Save media to storage |
598 | 598 | */ |
599 | - if($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE){ |
|
599 | + if ($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE) { |
|
600 | 600 | |
601 | 601 | // Update binary fields |
602 | 602 | foreach ($this->binaryFields as $name => $value) { |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if (empty($request->$value) == FALSE) { |
605 | 605 | $arResults->$value = $request->$value; |
606 | 606 | } |
607 | - else{ |
|
607 | + else { |
|
608 | 608 | $arResults->$value = NULL; |
609 | 609 | } |
610 | 610 | } |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | /** |
629 | 629 | * Redirect to index |
630 | 630 | */ |
631 | - if(!empty($request->custom_route)){ |
|
631 | + if (!empty($request->custom_route)) { |
|
632 | 632 | return redirect($request->custom_route); |
633 | 633 | } |
634 | 634 | else { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function boot() |
16 | 16 | { |
17 | 17 | // |
18 | - require_once app_path().'/Http/Helpers.php'; |
|
18 | + require_once app_path() . '/Http/Helpers.php'; |
|
19 | 19 | Paginator::useBootstrap(); |
20 | 20 | } |
21 | 21 |
@@ -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,24 +90,24 @@ 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 | - if(count($keyvalue) > 1) { |
|
105 | + if (count($keyvalue) > 1) { |
|
106 | 106 | |
107 | - $key = trim($keyvalue[0]); |
|
108 | - $value = trim($keyvalue[1]); |
|
107 | + $key = trim($keyvalue[ 0 ]); |
|
108 | + $value = trim($keyvalue[ 1 ]); |
|
109 | 109 | |
110 | - $allTables[$key] = $value; |
|
110 | + $allTables[ $key ] = $value; |
|
111 | 111 | |
112 | 112 | if (is_numeric($value) == TRUE) { |
113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | - request()->merge(['external_tables_filter' => $allTables]); |
|
119 | + request()->merge([ 'external_tables_filter' => $allTables ]); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $query; |