@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'description', 'position', 'image_id']; |
|
| 43 | + protected $fillable = [ 'name', 'description', 'position', 'image_id' ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Columns to exclude from index |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $excludedFromIndex = ['image']; |
|
| 50 | + protected $excludedFromIndex = [ 'image' ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Fields to search in fulltext mode |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return object |
| 85 | 85 | */ |
| 86 | - public function images(){ |
|
| 86 | + public function images() { |
|
| 87 | 87 | |
| 88 | 88 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 89 | 89 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param query $query |
| 98 | 98 | * @return query |
| 99 | 99 | */ |
| 100 | - public function scopeRelationships($query){ |
|
| 100 | + public function scopeRelationships($query) { |
|
| 101 | 101 | |
| 102 | 102 | return $query->with('images', 'images.imagecategories'); |
| 103 | 103 | } |
@@ -72,8 +72,7 @@ |
||
| 72 | 72 | { |
| 73 | 73 | if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
| 74 | 74 | return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
| 75 | - } |
|
| 76 | - else{ |
|
| 75 | + } else{ |
|
| 77 | 76 | return $query; |
| 78 | 77 | } |
| 79 | 78 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return \Illuminate\Database\Eloquent\Builder |
| 37 | 37 | */ |
| 38 | - public function scopeFulltextAllColumns(Builder $query){ |
|
| 38 | + public function scopeFulltextAllColumns(Builder $query) { |
|
| 39 | 39 | |
| 40 | 40 | return Helpers::virtualFulltextSearchColumns($query, request('search'), $this->fulltextFields); |
| 41 | 41 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @return \Illuminate\Database\Eloquent\Builder |
| 47 | 47 | */ |
| 48 | - public function scopeOrderByColumns(Builder $query){ |
|
| 48 | + public function scopeOrderByColumns(Builder $query) { |
|
| 49 | 49 | |
| 50 | 50 | return Helpers::orderByColumns($query, $this->defaultOrderBy); |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function scopeExcludeFromIndex(Builder $query) |
| 59 | 59 | { |
| 60 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex) ); |
|
| 60 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function scopeExcludeFromFind(Builder $query) |
| 69 | 69 | { |
| 70 | - if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
|
| 71 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
|
| 70 | + if (isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE) { |
|
| 71 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind)); |
|
| 72 | 72 | } |
| 73 | - else{ |
|
| 73 | + else { |
|
| 74 | 74 | return $query; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return \Illuminate\Database\Eloquent\Builder |
| 82 | 82 | */ |
| 83 | - public function scopeRelationships(Builder $query){ |
|
| 83 | + public function scopeRelationships(Builder $query) { |
|
| 84 | 84 | |
| 85 | 85 | return $query; |
| 86 | 86 | } |
@@ -90,30 +90,30 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return \Illuminate\Database\Eloquent\Builder |
| 92 | 92 | */ |
| 93 | - public function scopeExternalTablesFilter(Builder $query){ |
|
| 93 | + public function scopeExternalTablesFilter(Builder $query) { |
|
| 94 | 94 | |
| 95 | - if(Request::input('relation')){ |
|
| 95 | + if (Request::input('relation')) { |
|
| 96 | 96 | |
| 97 | - $allTables = []; |
|
| 97 | + $allTables = [ ]; |
|
| 98 | 98 | |
| 99 | 99 | $relations = explode(',', Request::input('relation')); |
| 100 | 100 | |
| 101 | - foreach ($relations as $relation){ |
|
| 101 | + foreach ($relations as $relation) { |
|
| 102 | 102 | |
| 103 | 103 | $keyvalue = explode(':', $relation); |
| 104 | 104 | |
| 105 | - $key = trim($keyvalue[0]); |
|
| 106 | - $value = trim($keyvalue[1]); |
|
| 105 | + $key = trim($keyvalue[ 0 ]); |
|
| 106 | + $value = trim($keyvalue[ 1 ]); |
|
| 107 | 107 | |
| 108 | - $allTables[$key] = $value; |
|
| 108 | + $allTables[ $key ] = $value; |
|
| 109 | 109 | |
| 110 | - if(is_numeric($value) == TRUE){ |
|
| 110 | + if (is_numeric($value) == TRUE) { |
|
| 111 | 111 | |
| 112 | - $query->where(strtolower($key)."_id", '=', $value); |
|
| 112 | + $query->where(strtolower($key) . "_id", '=', $value); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - request()->merge(['external_tables_filter' => $allTables]); |
|
| 116 | + request()->merge([ 'external_tables_filter' => $allTables ]); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return $query; |
@@ -126,8 +126,7 @@ |
||
| 126 | 126 | { |
| 127 | 127 | return round((($thisValue / ($lastValue / 100)) - 100), $round); |
| 128 | 128 | |
| 129 | - } |
|
| 130 | - else { |
|
| 129 | + } else { |
|
| 131 | 130 | |
| 132 | 131 | return 0; |
| 133 | 132 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @var array |
| 43 | 43 | */ |
| 44 | - protected $gaData = []; |
|
| 44 | + protected $gaData = [ ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Constructor |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * Module name for blade |
| 59 | 59 | */ |
| 60 | 60 | $temp = explode('.', $this->moduleBasicRoute); |
| 61 | - View::share('moduleNameBlade', $temp[0] . "_module_" . $temp[1]); |
|
| 61 | + View::share('moduleNameBlade', $temp[ 0 ] . "_module_" . $temp[ 1 ]); |
|
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | } |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | $ga = $this->getGAValues(); |
| 79 | 79 | } else { |
| 80 | 80 | |
| 81 | - $ga = []; |
|
| 81 | + $ga = [ ]; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $statistics = [ |
| 85 | 85 | 'ga' => $ga |
| 86 | 86 | ]; |
| 87 | 87 | |
| 88 | - return view('admin.modules.dashboard.index', ['statistics' => $statistics]); |
|
| 88 | + return view('admin.modules.dashboard.index', [ 'statistics' => $statistics ]); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * Get the data |
| 102 | 102 | */ |
| 103 | - $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 103 | + $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Calculate total |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $total = 0; |
| 109 | 109 | foreach ($data as $value) { |
| 110 | 110 | |
| 111 | - $total += $value[$type]; |
|
| 111 | + $total += $value[ $type ]; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | return $total; |
@@ -24,5 +24,5 @@ |
||
| 24 | 24 | protected $arValidationArray = [ |
| 25 | 25 | 'name' => 'required|max:255|unique:settings,name', |
| 26 | 26 | 'value' => 'max:255', |
| 27 | - 'description' => 'max:255']; |
|
| 27 | + 'description' => 'max:255' ]; |
|
| 28 | 28 | } |
@@ -151,8 +151,6 @@ discard block |
||
| 151 | 151 | /** |
| 152 | 152 | * Save transaction |
| 153 | 153 | * |
| 154 | - * @param int $typeId |
|
| 155 | - * @param string $text |
|
| 156 | 154 | * @param $userId |
| 157 | 155 | * @param $amount |
| 158 | 156 | */ |
@@ -242,7 +240,7 @@ discard block |
||
| 242 | 240 | * Change ar result if necessary |
| 243 | 241 | * |
| 244 | 242 | * @param $arResult |
| 245 | - * @return mixed |
|
| 243 | + * @return string|null |
|
| 246 | 244 | */ |
| 247 | 245 | public function changeEditResultField($arResult){ |
| 248 | 246 | return $arResult; |
@@ -319,7 +317,7 @@ discard block |
||
| 319 | 317 | * Store a newly created resource in storage. |
| 320 | 318 | * |
| 321 | 319 | * @param Request $request |
| 322 | - * @return Response |
|
| 320 | + * @return \Illuminate\Http\RedirectResponse |
|
| 323 | 321 | */ |
| 324 | 322 | public function store(Request $request) { |
| 325 | 323 | |
@@ -459,7 +457,7 @@ discard block |
||
| 459 | 457 | * |
| 460 | 458 | * @param Request $request |
| 461 | 459 | * @param int $id |
| 462 | - * @return Response |
|
| 460 | + * @return \Illuminate\Http\RedirectResponse |
|
| 463 | 461 | */ |
| 464 | 462 | public function update(Request $request, $id) { |
| 465 | 463 | |
@@ -591,7 +589,7 @@ discard block |
||
| 591 | 589 | * Remove the specified resource from storage. |
| 592 | 590 | * |
| 593 | 591 | * @param int $id |
| 594 | - * @return Response |
|
| 592 | + * @return \Illuminate\Http\RedirectResponse |
|
| 595 | 593 | */ |
| 596 | 594 | |
| 597 | 595 | public function destroy($id) { |
@@ -20,8 +20,6 @@ |
||
| 20 | 20 | use Illuminate\Support\Facades\View; |
| 21 | 21 | use App\Http\Controllers\Controller; |
| 22 | 22 | use Illuminate\Database\Eloquent\Builder; |
| 23 | -use Illuminate\Support\Facades\DB; |
|
| 24 | -use Carbon\Carbon; |
|
| 25 | 23 | use App\Transaction; |
| 26 | 24 | use App\User; |
| 27 | 25 | |
@@ -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 | |
@@ -279,10 +279,10 @@ discard block |
||
| 279 | 279 | /** |
| 280 | 280 | * Get media |
| 281 | 281 | */ |
| 282 | - if(method_exists($arResults, 'getMedia')){ |
|
| 282 | + if (method_exists($arResults, 'getMedia')) { |
|
| 283 | 283 | $media = $arResults->getMedia(); |
| 284 | 284 | } |
| 285 | - else{ |
|
| 285 | + else { |
|
| 286 | 286 | $media = null; |
| 287 | 287 | } |
| 288 | 288 | |
@@ -290,17 +290,17 @@ discard block |
||
| 290 | 290 | /** |
| 291 | 291 | * Choose the view |
| 292 | 292 | */ |
| 293 | - if(empty($this->customView['index']) == TRUE){ |
|
| 293 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
| 294 | 294 | $view = $this->moduleBasicTemplatePath . '.index'; |
| 295 | 295 | } |
| 296 | - else{ |
|
| 296 | + else { |
|
| 297 | 297 | $view = $this->customView; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
| 301 | 301 | * Return page |
| 302 | 302 | */ |
| 303 | - return view($view, ['results' => $arResults, 'media' => $media]); |
|
| 303 | + return view($view, [ 'results' => $arResults, 'media' => $media ]); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /** |
@@ -313,10 +313,10 @@ discard block |
||
| 313 | 313 | /** |
| 314 | 314 | * Choose the view |
| 315 | 315 | */ |
| 316 | - if(empty($this->customView['index']) == TRUE){ |
|
| 316 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
| 317 | 317 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
| 318 | 318 | } |
| 319 | - else{ |
|
| 319 | + else { |
|
| 320 | 320 | $view = $this->customView; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | * Change the validation array |
| 339 | 339 | */ |
| 340 | 340 | foreach ($this->arValidationArray as $name => $value) { |
| 341 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
| 342 | - $this->arValidationArray[$name] = $value . ',NULL,id,deleted_at,NULL'; |
|
| 341 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
| 342 | + $this->arValidationArray[ $name ] = $value . ',NULL,id,deleted_at,NULL'; |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | |
@@ -362,16 +362,16 @@ discard block |
||
| 362 | 362 | /** |
| 363 | 363 | * Datetime |
| 364 | 364 | */ |
| 365 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
| 365 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
| 366 | 366 | |
| 367 | - $object->{$name} = str_replace('T', ' ', $request->input($name)). ':00'; |
|
| 367 | + $object->{$name} = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
| 368 | 368 | } |
| 369 | 369 | else { |
| 370 | 370 | |
| 371 | 371 | /** |
| 372 | 372 | * Change to null if needed |
| 373 | 373 | */ |
| 374 | - if(strlen($request->$name) < 1){ |
|
| 374 | + if (strlen($request->$name) < 1) { |
|
| 375 | 375 | $object->{$name} = null; |
| 376 | 376 | } |
| 377 | 377 | else { |
@@ -429,21 +429,21 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | if (empty($arResults)) { |
| 431 | 431 | |
| 432 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
| 432 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
| 436 | 436 | * Set the put method for update |
| 437 | 437 | */ |
| 438 | - $arResults['_method'] = 'PUT'; |
|
| 438 | + $arResults[ '_method' ] = 'PUT'; |
|
| 439 | 439 | |
| 440 | 440 | /** |
| 441 | 441 | * Choose the view |
| 442 | 442 | */ |
| 443 | - if(empty($this->customView['index']) == TRUE){ |
|
| 443 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
| 444 | 444 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
| 445 | 445 | } |
| 446 | - else{ |
|
| 446 | + else { |
|
| 447 | 447 | $view = $this->customView; |
| 448 | 448 | } |
| 449 | 449 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | /** |
| 453 | 453 | * Return page |
| 454 | 454 | */ |
| 455 | - return view($view, ['results' => $arResults]); |
|
| 455 | + return view($view, [ 'results' => $arResults ]); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | /** |
@@ -480,8 +480,8 @@ discard block |
||
| 480 | 480 | */ |
| 481 | 481 | foreach ($this->arValidationArray as $name => $value) { |
| 482 | 482 | |
| 483 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
| 484 | - $this->arValidationArray[$name] = $value . ','.$id.',id,deleted_at,NULL'; |
|
| 483 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
| 484 | + $this->arValidationArray[ $name ] = $value . ',' . $id . ',id,deleted_at,NULL'; |
|
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | if ($arResults == FALSE) { |
| 503 | 503 | |
| 504 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
| 504 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | /** |
@@ -518,10 +518,10 @@ discard block |
||
| 518 | 518 | * Binary fields will not be updated if empty |
| 519 | 519 | * |
| 520 | 520 | */ |
| 521 | - if(in_array($name, $this->binaryFields)){ |
|
| 521 | + if (in_array($name, $this->binaryFields)) { |
|
| 522 | 522 | |
| 523 | 523 | } |
| 524 | - else{ |
|
| 524 | + else { |
|
| 525 | 525 | |
| 526 | 526 | /** |
| 527 | 527 | * Empty exception |
@@ -531,26 +531,26 @@ discard block |
||
| 531 | 531 | /** |
| 532 | 532 | * Datetime |
| 533 | 533 | */ |
| 534 | - if(in_array($name, $this->dateTimeLocalFields)){ |
|
| 534 | + if (in_array($name, $this->dateTimeLocalFields)) { |
|
| 535 | 535 | |
| 536 | - $arResults->$name = str_replace('T', ' ', $request->input($name)). ':00'; |
|
| 536 | + $arResults->$name = str_replace('T', ' ', $request->input($name)) . ':00'; |
|
| 537 | 537 | } |
| 538 | 538 | else { |
| 539 | 539 | $arResults->$name = $request->input($name); |
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - else{ |
|
| 543 | + else { |
|
| 544 | 544 | |
| 545 | 545 | /** |
| 546 | 546 | * Numeric zero ? |
| 547 | 547 | */ |
| 548 | - if(isset($request->$name) && is_numeric($request->input($name)) == TRUE){ |
|
| 548 | + if (isset($request->$name) && is_numeric($request->input($name)) == TRUE) { |
|
| 549 | 549 | |
| 550 | 550 | $arResults->$name = $request->input($name); |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | - else{ |
|
| 553 | + else { |
|
| 554 | 554 | $arResults->$name = NULL; |
| 555 | 555 | } |
| 556 | 556 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | /** |
| 569 | 569 | * Save media to storage |
| 570 | 570 | */ |
| 571 | - if($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE){ |
|
| 571 | + if ($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE) { |
|
| 572 | 572 | |
| 573 | 573 | // Update binary fields |
| 574 | 574 | foreach ($this->binaryFields as $name => $value) { |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | if (empty($request->$value) == FALSE) { |
| 577 | 577 | $arResults->$value = $request->$value; |
| 578 | 578 | } |
| 579 | - else{ |
|
| 579 | + else { |
|
| 580 | 580 | $arResults->$value = NULL; |
| 581 | 581 | } |
| 582 | 582 | } |
@@ -202,8 +202,7 @@ discard block |
||
| 202 | 202 | if ($this->paginateRows == NULL) { |
| 203 | 203 | |
| 204 | 204 | return env('ADMIN_PAGINATE', 10); |
| 205 | - } |
|
| 206 | - else{ |
|
| 205 | + } else{ |
|
| 207 | 206 | |
| 208 | 207 | return $this->paginateRows; |
| 209 | 208 | } |
@@ -281,8 +280,7 @@ discard block |
||
| 281 | 280 | */ |
| 282 | 281 | if(method_exists($arResults, 'getMedia')){ |
| 283 | 282 | $media = $arResults->getMedia(); |
| 284 | - } |
|
| 285 | - else{ |
|
| 283 | + } else{ |
|
| 286 | 284 | $media = null; |
| 287 | 285 | } |
| 288 | 286 | |
@@ -292,8 +290,7 @@ discard block |
||
| 292 | 290 | */ |
| 293 | 291 | if(empty($this->customView['index']) == TRUE){ |
| 294 | 292 | $view = $this->moduleBasicTemplatePath . '.index'; |
| 295 | - } |
|
| 296 | - else{ |
|
| 293 | + } else{ |
|
| 297 | 294 | $view = $this->customView; |
| 298 | 295 | } |
| 299 | 296 | |
@@ -315,8 +312,7 @@ discard block |
||
| 315 | 312 | */ |
| 316 | 313 | if(empty($this->customView['index']) == TRUE){ |
| 317 | 314 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
| 318 | - } |
|
| 319 | - else{ |
|
| 315 | + } else{ |
|
| 320 | 316 | $view = $this->customView; |
| 321 | 317 | } |
| 322 | 318 | |
@@ -365,16 +361,14 @@ discard block |
||
| 365 | 361 | if(in_array($name, $this->dateTimeLocalFields)){ |
| 366 | 362 | |
| 367 | 363 | $object->{$name} = str_replace('T', ' ', $request->input($name)). ':00'; |
| 368 | - } |
|
| 369 | - else { |
|
| 364 | + } else { |
|
| 370 | 365 | |
| 371 | 366 | /** |
| 372 | 367 | * Change to null if needed |
| 373 | 368 | */ |
| 374 | 369 | if(strlen($request->$name) < 1){ |
| 375 | 370 | $object->{$name} = null; |
| 376 | - } |
|
| 377 | - else { |
|
| 371 | + } else { |
|
| 378 | 372 | $object->{$name} = $request->input($name); |
| 379 | 373 | } |
| 380 | 374 | } |
@@ -442,8 +436,7 @@ discard block |
||
| 442 | 436 | */ |
| 443 | 437 | if(empty($this->customView['index']) == TRUE){ |
| 444 | 438 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
| 445 | - } |
|
| 446 | - else{ |
|
| 439 | + } else{ |
|
| 447 | 440 | $view = $this->customView; |
| 448 | 441 | } |
| 449 | 442 | |
@@ -520,8 +513,7 @@ discard block |
||
| 520 | 513 | */ |
| 521 | 514 | if(in_array($name, $this->binaryFields)){ |
| 522 | 515 | |
| 523 | - } |
|
| 524 | - else{ |
|
| 516 | + } else{ |
|
| 525 | 517 | |
| 526 | 518 | /** |
| 527 | 519 | * Empty exception |
@@ -534,13 +526,10 @@ discard block |
||
| 534 | 526 | if(in_array($name, $this->dateTimeLocalFields)){ |
| 535 | 527 | |
| 536 | 528 | $arResults->$name = str_replace('T', ' ', $request->input($name)). ':00'; |
| 537 | - } |
|
| 538 | - else { |
|
| 529 | + } else { |
|
| 539 | 530 | $arResults->$name = $request->input($name); |
| 540 | 531 | } |
| 541 | - } |
|
| 542 | - |
|
| 543 | - else{ |
|
| 532 | + } else{ |
|
| 544 | 533 | |
| 545 | 534 | /** |
| 546 | 535 | * Numeric zero ? |
@@ -548,9 +537,7 @@ discard block |
||
| 548 | 537 | if(isset($request->$name) && is_numeric($request->input($name)) == TRUE){ |
| 549 | 538 | |
| 550 | 539 | $arResults->$name = $request->input($name); |
| 551 | - } |
|
| 552 | - |
|
| 553 | - else{ |
|
| 540 | + } else{ |
|
| 554 | 541 | $arResults->$name = NULL; |
| 555 | 542 | } |
| 556 | 543 | } |
@@ -575,8 +562,7 @@ discard block |
||
| 575 | 562 | |
| 576 | 563 | if (empty($request->$value) == FALSE) { |
| 577 | 564 | $arResults->$value = $request->$value; |
| 578 | - } |
|
| 579 | - else{ |
|
| 565 | + } else{ |
|
| 580 | 566 | $arResults->$value = NULL; |
| 581 | 567 | } |
| 582 | 568 | } |
@@ -67,6 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Reset all session fields |
| 70 | + * @param \Illuminate\Http\Request $request |
|
| 70 | 71 | */ |
| 71 | 72 | protected function _resetSessionFields($request){ |
| 72 | 73 | |
@@ -130,6 +131,9 @@ discard block |
||
| 130 | 131 | return Page::findOrFail($id); |
| 131 | 132 | } |
| 132 | 133 | |
| 134 | + /** |
|
| 135 | + * @param integer $id |
|
| 136 | + */ |
|
| 133 | 137 | protected function _getSettings($id){ |
| 134 | 138 | |
| 135 | 139 | $settings = Settings::find($id); |
@@ -145,8 +149,6 @@ discard block |
||
| 145 | 149 | /** |
| 146 | 150 | * Save transaction |
| 147 | 151 | * |
| 148 | - * @param int $typeId |
|
| 149 | - * @param string $text |
|
| 150 | 152 | * @param $userId |
| 151 | 153 | * @param $amount |
| 152 | 154 | */ |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $_arViewData = []; |
|
| 34 | + protected $_arViewData = [ ]; |
|
| 35 | 35 | |
| 36 | - protected $_arViewGeneratedData = []; |
|
| 36 | + protected $_arViewGeneratedData = [ ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Check if view exists, if so - return, if not throw 404 |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | * @param string $strView |
| 42 | 42 | * @return View|void |
| 43 | 43 | */ |
| 44 | - protected function _showViewOr404($strView){ |
|
| 44 | + protected function _showViewOr404($strView) { |
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | if (view()->exists($strView)) { |
| 48 | 48 | return view($strView, $this->_arViewData); |
| 49 | 49 | } |
| 50 | - else{ |
|
| 50 | + else { |
|
| 51 | 51 | return abort(404); |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | * Save all inputs to session |
| 57 | 57 | * @param $request |
| 58 | 58 | */ |
| 59 | - protected function _saveSessionFields($request){ |
|
| 59 | + protected function _saveSessionFields($request) { |
|
| 60 | 60 | |
| 61 | - foreach ($request->all() as $key=>$value){ |
|
| 62 | - $arData[$key] = $value; |
|
| 61 | + foreach ($request->all() as $key=>$value) { |
|
| 62 | + $arData[ $key ] = $value; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $request->session()->put('frontend_fields', $arData); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Reset all session fields |
| 70 | 70 | */ |
| 71 | - protected function _resetSessionFields($request){ |
|
| 71 | + protected function _resetSessionFields($request) { |
|
| 72 | 72 | |
| 73 | 73 | $request->session()->forget('frontend_fields'); |
| 74 | 74 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @param $request |
| 80 | 80 | */ |
| 81 | - protected function _calculatePrice($request){ |
|
| 81 | + protected function _calculatePrice($request) { |
|
| 82 | 82 | |
| 83 | 83 | return 0; |
| 84 | 84 | } |
@@ -89,24 +89,24 @@ discard block |
||
| 89 | 89 | * @param $request |
| 90 | 90 | * @return mixed |
| 91 | 91 | */ |
| 92 | - protected function _getSessionFields($request){ |
|
| 92 | + protected function _getSessionFields($request) { |
|
| 93 | 93 | |
| 94 | 94 | $fields = $request->session()->get('frontend_fields'); |
| 95 | 95 | |
| 96 | - if(isset($request->id)){ |
|
| 96 | + if (isset($request->id)) { |
|
| 97 | 97 | //$fields['price'] = $this->_calculatePrice($request); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if(isset($fields['city'])) { |
|
| 101 | - $arCityInfo = explode('|', $fields['city']); |
|
| 100 | + if (isset($fields[ 'city' ])) { |
|
| 101 | + $arCityInfo = explode('|', $fields[ 'city' ]); |
|
| 102 | 102 | |
| 103 | - $fields['citypart'] = @trim($arCityInfo[0]); |
|
| 104 | - $fields['citymain'] = @trim($arCityInfo[1]); |
|
| 105 | - $fields['county'] = @trim($arCityInfo[2]); |
|
| 106 | - $fields['zip'] = @trim($arCityInfo[3]); |
|
| 103 | + $fields[ 'citypart' ] = @trim($arCityInfo[ 0 ]); |
|
| 104 | + $fields[ 'citymain' ] = @trim($arCityInfo[ 1 ]); |
|
| 105 | + $fields[ 'county' ] = @trim($arCityInfo[ 2 ]); |
|
| 106 | + $fields[ 'zip' ] = @trim($arCityInfo[ 3 ]); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $this->_arViewData['fields'] = $fields; |
|
| 109 | + $this->_arViewData[ 'fields' ] = $fields; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @param $url |
| 116 | 116 | * @return mixed |
| 117 | 117 | */ |
| 118 | - protected function _loadPageByUrl($url){ |
|
| 118 | + protected function _loadPageByUrl($url) { |
|
| 119 | 119 | |
| 120 | 120 | return Page::where('url', $url)->firstOrFail(); |
| 121 | 121 | } |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | * @param $id |
| 127 | 127 | * @return mixed |
| 128 | 128 | */ |
| 129 | - protected function _loadPageById($id){ |
|
| 129 | + protected function _loadPageById($id) { |
|
| 130 | 130 | return Page::findOrFail($id); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - protected function _getSettings($id){ |
|
| 133 | + protected function _getSettings($id) { |
|
| 134 | 134 | |
| 135 | 135 | $settings = Settings::find($id); |
| 136 | 136 | |
| 137 | - if(!empty($settings)){ |
|
| 138 | - return $settings['value']; |
|
| 137 | + if (!empty($settings)) { |
|
| 138 | + return $settings[ 'value' ]; |
|
| 139 | 139 | } |
| 140 | - else{ |
|
| 140 | + else { |
|
| 141 | 141 | return NULL; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @param $amount |
| 152 | 152 | */ |
| 153 | 153 | protected function _saveTransation($status_id = 1, $user_id, $amount, |
| 154 | - $campaign_id = null, $payment_id = null, $recommendation_id = null){ |
|
| 154 | + $campaign_id = null, $payment_id = null, $recommendation_id = null) { |
|
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * Save transaction |
@@ -46,8 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if (view()->exists($strView)) { |
| 48 | 48 | return view($strView, $this->_arViewData); |
| 49 | - } |
|
| 50 | - else{ |
|
| 49 | + } else{ |
|
| 51 | 50 | return abort(404); |
| 52 | 51 | } |
| 53 | 52 | } |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | |
| 137 | 136 | if(!empty($settings)){ |
| 138 | 137 | return $settings['value']; |
| 139 | - } |
|
| 140 | - else{ |
|
| 138 | + } else{ |
|
| 141 | 139 | return NULL; |
| 142 | 140 | } |
| 143 | 141 | } |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | namespace App\Http\Controllers\Frontend; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -use App\Application; |
|
| 19 | 18 | use App\Campaign; |
| 20 | 19 | use App\Payment; |
| 21 | 20 | use App\Transaction; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param Request $request |
| 41 | 41 | * @return View|void |
| 42 | 42 | */ |
| 43 | - public function getHomepage(Request $request){ |
|
| 43 | + public function getHomepage(Request $request) { |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Load data |
@@ -50,22 +50,22 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Number of users |
| 52 | 52 | */ |
| 53 | - $this->_arViewData['users_no'] = User::count() + 135000; |
|
| 53 | + $this->_arViewData[ 'users_no' ] = User::count() + 135000; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * Number of campaigns |
| 57 | 57 | */ |
| 58 | - $this->_arViewData['campaigns_no'] = Campaign::count(); |
|
| 58 | + $this->_arViewData[ 'campaigns_no' ] = Campaign::count(); |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Number of payments total |
| 62 | 62 | */ |
| 63 | - $this->_arViewData['payments_no_total'] = Payment::sum('amount'); |
|
| 63 | + $this->_arViewData[ 'payments_no_total' ] = Payment::sum('amount'); |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Number of payments last month |
| 67 | 67 | */ |
| 68 | - $this->_arViewData['payments_no_last_month'] = Payment::where('created_at', '>=', Carbon::now()->subMonth())->count(); |
|
| 68 | + $this->_arViewData[ 'payments_no_last_month' ] = Payment::where('created_at', '>=', Carbon::now()->subMonth())->count(); |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Return view |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param Request $request |
| 80 | 80 | * @return View|void |
| 81 | 81 | */ |
| 82 | - public function getContact(Request $request){ |
|
| 82 | + public function getContact(Request $request) { |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Clear sessions |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | * @param Request $request |
| 104 | 104 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 105 | 105 | */ |
| 106 | - public function registerEmail(Request $request){ |
|
| 106 | + public function registerEmail(Request $request) { |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Validate |
| 110 | 110 | */ |
| 111 | - if(env('RECAPTCHA_ENABLED') == 1){ |
|
| 111 | + if (env('RECAPTCHA_ENABLED') == 1) { |
|
| 112 | 112 | $this->validate($request, [ |
| 113 | 113 | 'email' => 'email|required|max:255', |
| 114 | 114 | 'g-recaptcha-response' => 'required|recaptcha' |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | /** |
| 144 | 144 | * User not exists |
| 145 | 145 | */ |
| 146 | - if(empty($user)){ |
|
| 146 | + if (empty($user)) { |
|
| 147 | 147 | |
| 148 | 148 | $login = $email; |
| 149 | 149 | $password = str_random(10); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * Save recommendation |
| 161 | 161 | */ |
| 162 | - if(Cache::has('recommendation_id')){ |
|
| 162 | + if (Cache::has('recommendation_id')) { |
|
| 163 | 163 | |
| 164 | 164 | $recommendation_id = Cache::get('recommendation_id'); |
| 165 | 165 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | /** |
| 178 | 178 | * If not , add to user |
| 179 | 179 | */ |
| 180 | - if(empty($test)){ |
|
| 180 | + if (empty($test)) { |
|
| 181 | 181 | $user->recommendation_id = $recommendation_id; |
| 182 | 182 | |
| 183 | 183 | } |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | /** |
| 189 | 189 | * Send e-mail |
| 190 | 190 | */ |
| 191 | - Mail::send(['emails.html.registration', 'emails.plain.registration'], [ |
|
| 191 | + Mail::send([ 'emails.html.registration', 'emails.plain.registration' ], [ |
|
| 192 | 192 | 'user' => $user, |
| 193 | 193 | 'login' => $login, |
| 194 | 194 | 'password' => $password, |
| 195 | 195 | 'activation_code' => $activation_code |
| 196 | 196 | |
| 197 | - ], function ($message) { |
|
| 197 | + ], function($message) { |
|
| 198 | 198 | $message->from(env('MAIL_FROM_EMAIL', '[email protected]'), env('MAIL_FROM_NAME', 'Surimail.cz')); |
| 199 | 199 | $message->to(request('email'), request('email')); |
| 200 | 200 | $message->subject('Registrace na serveru Surimail.cz'); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * User exists - error |
| 209 | 209 | */ |
| 210 | - else{ |
|
| 210 | + else { |
|
| 211 | 211 | |
| 212 | 212 | $request->session()->flash('custom_error', 'Zadaný e-mail nebo IP již existuje'); |
| 213 | 213 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @param Request $request |
| 224 | 224 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 225 | 225 | */ |
| 226 | - public function checkActivationCode($email, $activationCode, Request $request){ |
|
| 226 | + public function checkActivationCode($email, $activationCode, Request $request) { |
|
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | 229 | * Check if user exists |
@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | /** |
| 234 | 234 | * User not exists or code is not valid |
| 235 | 235 | */ |
| 236 | - if(empty($user)){ |
|
| 236 | + if (empty($user)) { |
|
| 237 | 237 | $request->session()->flash('custom_error', 'Zadaný e-mail neexistuje nebo je neplatný aktivační kód'); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | 241 | * User exists - activate him |
| 242 | 242 | */ |
| 243 | - else{ |
|
| 243 | + else { |
|
| 244 | 244 | $user->active = true; |
| 245 | 245 | $user->activation_code = str_random(16); |
| 246 | 246 | $user->save(); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * Add reward for registration |
| 250 | 250 | */ |
| 251 | 251 | $rewardsCount = Transaction::where('transactionstatus_id', 5)->where('user_id', $user->id)->count(); |
| 252 | - if($rewardsCount < 1){ |
|
| 252 | + if ($rewardsCount < 1) { |
|
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * Save transaction |
@@ -261,25 +261,25 @@ discard block |
||
| 261 | 261 | * Add reward for recommedation |
| 262 | 262 | */ |
| 263 | 263 | |
| 264 | - if(!empty($user->recomendation_id) ){ |
|
| 264 | + if (!empty($user->recomendation_id)) { |
|
| 265 | 265 | |
| 266 | 266 | $recommendation = Recommendation::find($user->reccomendation_id); |
| 267 | 267 | |
| 268 | - if(!empty($recommendation)){ |
|
| 268 | + if (!empty($recommendation)) { |
|
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * Check transaction |
| 272 | 272 | */ |
| 273 | 273 | $transactionCount = Transaction::where('recommendation_id', $recommendation->id)->count(); |
| 274 | 274 | |
| 275 | - if($transactionCount < 1){ |
|
| 275 | + if ($transactionCount < 1) { |
|
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | 278 | * Find user and save money |
| 279 | 279 | */ |
| 280 | 280 | $rUser = User::find($recommendation->user_id); |
| 281 | 281 | |
| 282 | - if(!empty($rUser)){ |
|
| 282 | + if (!empty($rUser)) { |
|
| 283 | 283 | |
| 284 | 284 | $this->_saveTransation(2, $rUser->id, $this->_getSettings(2)); |
| 285 | 285 | } |
@@ -288,12 +288,12 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | $request->session()->flash('success', 'Gratulujeme, váš účet byl úspěšně aktivován. Přihlásit se můžete zde: ' |
| 291 | - . '<br><a href="'.route('admin.dashboard.index').'">'.route('admin.dashboard.index').'</a>'); |
|
| 291 | + . '<br><a href="' . route('admin.dashboard.index') . '">' . route('admin.dashboard.index') . '</a>'); |
|
| 292 | 292 | |
| 293 | 293 | /** |
| 294 | 294 | * Save reward |
| 295 | 295 | */ |
| 296 | - if($user->recommendation_id != null && $user->recommendation_id > 0){ |
|
| 296 | + if ($user->recommendation_id != null && $user->recommendation_id > 0) { |
|
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | 299 | * Load recommendation |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * @param Request $request |
| 315 | 315 | * @return View|void |
| 316 | 316 | */ |
| 317 | - public function index($pageUrl, Request $request){ |
|
| 317 | + public function index($pageUrl, Request $request) { |
|
| 318 | 318 | |
| 319 | 319 | /** |
| 320 | 320 | * Clear sessions |
@@ -339,19 +339,19 @@ discard block |
||
| 339 | 339 | * @param Request $request |
| 340 | 340 | * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector |
| 341 | 341 | */ |
| 342 | - public function checkRecommmendation($id, Request $request){ |
|
| 342 | + public function checkRecommmendation($id, Request $request) { |
|
| 343 | 343 | |
| 344 | 344 | /** |
| 345 | 345 | * @todo Use validator |
| 346 | 346 | */ |
| 347 | - if(is_numeric($id)){ |
|
| 347 | + if (is_numeric($id)) { |
|
| 348 | 348 | |
| 349 | 349 | $recommendation = Recommendation::find($id); |
| 350 | 350 | |
| 351 | 351 | /** |
| 352 | 352 | * If exists, than remember |
| 353 | 353 | */ |
| 354 | - if(!empty($recommendation)){ |
|
| 354 | + if (!empty($recommendation)) { |
|
| 355 | 355 | Cache::forever('recommendation_id', $id); |
| 356 | 356 | } |
| 357 | 357 | } |
@@ -113,8 +113,7 @@ |
||
| 113 | 113 | 'email' => 'email|required|max:255', |
| 114 | 114 | 'g-recaptcha-response' => 'required|recaptcha' |
| 115 | 115 | ]); |
| 116 | - } |
|
| 117 | - else { |
|
| 116 | + } else { |
|
| 118 | 117 | |
| 119 | 118 | $this->validate($request, [ |
| 120 | 119 | 'email' => 'email|required|max:255' |
@@ -19,7 +19,6 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * Register any application authentication / authorization services. |
| 21 | 21 | * |
| 22 | - * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
| 23 | 22 | * @return void |
| 24 | 23 | */ |
| 25 | 24 | public function boot() |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Providers; |
| 4 | 4 | |
| 5 | -use Illuminate\Contracts\Auth\Access\Gate as GateContract; |
|
| 6 | 5 | use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; |
| 7 | 6 | |
| 8 | 7 | class AuthServiceProvider extends ServiceProvider |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * Register any other events for your application. |
| 23 | 23 | * |
| 24 | - * @param \Illuminate\Contracts\Events\Dispatcher $events |
|
| 25 | 24 | * @return void |
| 26 | 25 | */ |
| 27 | 26 | public function boot() |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Providers; |
| 4 | 4 | |
| 5 | -use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; |
|
| 6 | 5 | use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; |
| 7 | 6 | |
| 8 | 7 | class EventServiceProvider extends ServiceProvider |