@@ -30,7 +30,7 @@ discard block |
||
| 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 |
||
| 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 |
@@ -30,12 +30,12 @@ discard block |
||
| 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 |
||
| 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 |
||
| 119 | 119 | */ |
| 120 | 120 | else { |
| 121 | 121 | |
| 122 | - $validIDs[] = $advertlocation_id; |
|
| 122 | + $validIDs[ ] = $advertlocation_id; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -31,25 +31,25 @@ |
||
| 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); |
@@ -39,7 +39,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -31,12 +31,12 @@ |
||
| 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); |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | if (is_numeric($fieldName) == TRUE) { |
| 46 | 46 | $fieldName = $fieldAttributes; |
| 47 | - $fieldAttributes = ['operator' => '=', 'prefix' => '', 'sufix' => '']; |
|
| 47 | + $fieldAttributes = [ 'operator' => '=', 'prefix' => '', 'sufix' => '' ]; |
|
| 48 | 48 | } |
| 49 | - if (isset($fieldAttributes['operator']) == FALSE) { |
|
| 50 | - $fieldAttributes['operator'] = '='; |
|
| 49 | + if (isset($fieldAttributes[ 'operator' ]) == FALSE) { |
|
| 50 | + $fieldAttributes[ 'operator' ] = '='; |
|
| 51 | 51 | } |
| 52 | - if (isset($fieldAttributes['prefix']) == FALSE) { |
|
| 53 | - $fieldAttributes['prefix'] = ''; |
|
| 52 | + if (isset($fieldAttributes[ 'prefix' ]) == FALSE) { |
|
| 53 | + $fieldAttributes[ 'prefix' ] = ''; |
|
| 54 | 54 | } |
| 55 | - if (isset($fieldAttributes['sufix']) == FALSE) { |
|
| 56 | - $fieldAttributes['sufix'] = ''; |
|
| 55 | + if (isset($fieldAttributes[ 'sufix' ]) == FALSE) { |
|
| 56 | + $fieldAttributes[ 'sufix' ] = ''; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | if ($first == TRUE) { |
| 63 | 63 | |
| 64 | - $query->where($fieldName, $fieldAttributes['operator'], $fieldAttributes['prefix'] . $word |
|
| 65 | - . $fieldAttributes['sufix']); |
|
| 64 | + $query->where($fieldName, $fieldAttributes[ 'operator' ], $fieldAttributes[ 'prefix' ] . $word |
|
| 65 | + . $fieldAttributes[ 'sufix' ]); |
|
| 66 | 66 | |
| 67 | 67 | $first = FALSE; |
| 68 | 68 | } else { |
| 69 | - $query->orWhere($fieldName, $fieldAttributes['operator'], $fieldAttributes['prefix'] . $word |
|
| 70 | - . $fieldAttributes['sufix']); |
|
| 69 | + $query->orWhere($fieldName, $fieldAttributes[ 'operator' ], $fieldAttributes[ 'prefix' ] . $word |
|
| 70 | + . $fieldAttributes[ 'sufix' ]); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @param array $possibleParameters |
| 105 | 105 | * @return boolean |
| 106 | 106 | */ |
| 107 | - public static function resetSaveIndexParameters($module, $possibleParameters = ['search', 'orderbycolumn', 'orderbytype', 'relation']) |
|
| 107 | + public static function resetSaveIndexParameters($module, $possibleParameters = [ 'search', 'orderbycolumn', 'orderbytype', 'relation' ]) |
|
| 108 | 108 | { |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | foreach ($allParameters as $parameter => $value) { |
| 119 | 119 | |
| 120 | - $cacheKey = implode('.', [$module, Auth::user()->id, $parameter]); |
|
| 120 | + $cacheKey = implode('.', [ $module, Auth::user()->id, $parameter ]); |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Reset |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | if (empty($value) == TRUE) { |
| 126 | 126 | |
| 127 | 127 | Cache::forget($cacheKey); |
| 128 | - unset($allParameters[$parameter]); |
|
| 128 | + unset($allParameters[ $parameter ]); |
|
| 129 | 129 | } /** |
| 130 | 130 | * Save |
| 131 | 131 | */ else { |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | foreach ($possibleParameters as $parameter => $value) { |
| 141 | 141 | |
| 142 | - $cacheKey = implode('.', [$module, Auth::user()->id, $value]); |
|
| 142 | + $cacheKey = implode('.', [ $module, Auth::user()->id, $value ]); |
|
| 143 | 143 | |
| 144 | - $allParameters[$value] = Cache::get($cacheKey); |
|
| 144 | + $allParameters[ $value ] = Cache::get($cacheKey); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | if (preg_match('/content: \$fa-var-(.*)\;/', $row, $matches) == TRUE) { |
| 251 | 251 | |
| 252 | - $icons[] = "fa-" . $matches[1]; |
|
| 252 | + $icons[ ] = "fa-" . $matches[ 1 ]; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | } |
@@ -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', '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 |
||
| 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 |
||
| 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 | } |
@@ -32,21 +32,21 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 35 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes that are mass assignable. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $fillable = ['name', 'description', 'class']; |
|
| 42 | + protected $fillable = [ 'name', 'description', 'class' ]; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Columns to exclude from index |
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $excludedFromIndex = []; |
|
| 49 | + protected $excludedFromIndex = [ ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Fields to search in fulltext mode |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return object |
| 88 | 88 | */ |
| 89 | - public function pages(){ |
|
| 89 | + public function pages() { |
|
| 90 | 90 | |
| 91 | 91 | return $this->belongsToMany('App\Page', 'page_pagecategory', 'page_id', 'pagecategory_id'); |
| 92 | 92 | } |
@@ -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('pages'); |
| 103 | 103 | } |
@@ -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 | } |