@@ -33,22 +33,22 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at', 'published_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at', 'published_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', 'author_name', 'meta_title', 'meta_description', |
|
| 44 | - 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at']; |
|
| 43 | + protected $fillable = [ 'name', 'author_name', 'meta_title', 'meta_description', |
|
| 44 | + 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Columns to exclude from index |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $excludedFromIndex = []; |
|
| 51 | + protected $excludedFromIndex = [ ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Fields to search in fulltext mode |
@@ -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', |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @return object |
| 98 | 98 | */ |
| 99 | - public function pagecategories(){ |
|
| 99 | + public function pagecategories() { |
|
| 100 | 100 | |
| 101 | 101 | return $this->belongsToMany('App\PageCategory', 'page_pagecategory', 'page_id', 'pagecategory_id'); |
| 102 | 102 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @return object |
| 108 | 108 | */ |
| 109 | - public function comments(){ |
|
| 109 | + public function comments() { |
|
| 110 | 110 | |
| 111 | 111 | return $this->hasMany('App\Comment', 'page_id'); |
| 112 | 112 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @return object |
| 118 | 118 | */ |
| 119 | - public function users(){ |
|
| 119 | + public function users() { |
|
| 120 | 120 | |
| 121 | 121 | return $this->belongsTo('App\User', 'user_id'); |
| 122 | 122 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @param query $query |
| 128 | 128 | * @return query |
| 129 | 129 | */ |
| 130 | - public function scopeRelationships($query){ |
|
| 130 | + public function scopeRelationships($query) { |
|
| 131 | 131 | |
| 132 | 132 | return $query->with('images', 'images.imagecategories', 'pagecategories', 'users'); |
| 133 | 133 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | protected $arValidationArray = [ |
| 30 | 30 | 'name' => 'required|max:255', |
| 31 | 31 | 'email' => 'required|email|max:255|unique:users,email', |
| 32 | - 'password' => 'required|confirmed|min:6']; |
|
| 32 | + 'password' => 'required|confirmed|min:6' ]; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Store function override |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | * Create row |
| 49 | 49 | */ |
| 50 | 50 | User::create([ |
| 51 | - 'name' => $request['name'], |
|
| 52 | - 'email' => $request['email'], |
|
| 53 | - 'password' => Hash::make($request['password']), |
|
| 51 | + 'name' => $request[ 'name' ], |
|
| 52 | + 'email' => $request[ 'email' ], |
|
| 53 | + 'password' => Hash::make($request[ 'password' ]), |
|
| 54 | 54 | ]); |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | $this->validate($request, [ |
| 75 | 75 | 'name' => 'required|max:255', |
| 76 | - 'email' => 'required|email|max:255|unique:users,email_address,'.$id, |
|
| 77 | - 'password' => 'required|confirmed|min:6']); |
|
| 76 | + 'email' => 'required|email|max:255|unique:users,email_address,' . $id, |
|
| 77 | + 'password' => 'required|confirmed|min:6' ]); |
|
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * Get the row |
@@ -84,22 +84,22 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Row does not exist - redirect |
| 86 | 86 | */ |
| 87 | - if($arResults == FALSE){ |
|
| 87 | + if ($arResults == FALSE) { |
|
| 88 | 88 | |
| 89 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
| 89 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Set updated values |
| 94 | 94 | */ |
| 95 | - $arResults->name = $request['name']; |
|
| 96 | - $arResults->email = $request['email']; |
|
| 95 | + $arResults->name = $request[ 'name' ]; |
|
| 96 | + $arResults->email = $request[ 'email' ]; |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Possible password change |
| 100 | 100 | */ |
| 101 | - if($request['password'] != '######'){ |
|
| 102 | - $arResults->password = Hash::make($request['password']); |
|
| 101 | + if ($request[ 'password' ] != '######') { |
|
| 102 | + $arResults->password = Hash::make($request[ 'password' ]); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * Associate relationships to other table |
| 103 | 103 | */ |
| 104 | - public function associateRelationships($object, Request $request){ |
|
| 104 | + public function associateRelationships($object, Request $request) { |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Validate category ID, if failed set to default |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $object->imagecategories()->associate(1); |
| 116 | 116 | } |
| 117 | - else{ |
|
| 117 | + else { |
|
| 118 | 118 | |
| 119 | 119 | $object->imagecategories()->associate($request->input('imagecategory_id')); |
| 120 | 120 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Add lookup tables |
| 33 | 33 | */ |
| 34 | - $this->middleware('add.lookup.tables:User', ['only' => ['create', 'edit']]); |
|
| 35 | - $this->middleware('add.lookup.tables:ArticleCategory', ['only' => ['create', 'edit']]); |
|
| 36 | - $this->middleware('add.published.at', ['only' => ['store', 'update']]); |
|
| 34 | + $this->middleware('add.lookup.tables:User', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 35 | + $this->middleware('add.lookup.tables:ArticleCategory', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 36 | + $this->middleware('add.published.at', [ 'only' => [ 'store', 'update' ] ]); |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Other tables |
| 40 | 40 | */ |
| 41 | - $this->middleware('media.image.select:Image', ['only' => ['create', 'edit']]); |
|
| 41 | + $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * Validate article category ID, if failed set to default |
| 122 | 122 | */ |
| 123 | - if($request->has('articlecategory_id')){ |
|
| 123 | + if ($request->has('articlecategory_id')) { |
|
| 124 | 124 | |
| 125 | - $validIDs = []; |
|
| 125 | + $validIDs = [ ]; |
|
| 126 | 126 | |
| 127 | 127 | foreach ($request->input('articlecategory_id') as $articlecategory_id) { |
| 128 | 128 | |
| 129 | - $arrayForValidator = ['articlecategory_id' => $articlecategory_id]; |
|
| 129 | + $arrayForValidator = [ 'articlecategory_id' => $articlecategory_id ]; |
|
| 130 | 130 | |
| 131 | 131 | $validator = Validator::make($arrayForValidator, [ |
| 132 | 132 | 'articlecategory_id' => 'required|integer|min:1|exists:articlecategory,id', |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * Validator OK - save it |
| 144 | 144 | */ else { |
| 145 | 145 | |
| 146 | - $validIDs[] = $articlecategory_id; |
|
| 146 | + $validIDs[ ] = $articlecategory_id; |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
@@ -25,5 +25,5 @@ |
||
| 25 | 25 | protected $arValidationArray = [ |
| 26 | 26 | 'name' => 'required|max:255|unique:imagecategory,name', |
| 27 | 27 | 'description' => 'max:255', |
| 28 | - 'color' => 'max:255']; |
|
| 28 | + 'color' => 'max:255' ]; |
|
| 29 | 29 | } |
@@ -24,5 +24,5 @@ |
||
| 24 | 24 | protected $arValidationArray = [ |
| 25 | 25 | 'name' => 'required|max:255|unique:slider,name', |
| 26 | 26 | 'description' => 'max:255', |
| 27 | - 'cycle_interval' => 'required|integer|min:1']; |
|
| 27 | + 'cycle_interval' => 'required|integer|min:1' ]; |
|
| 28 | 28 | } |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Add lookup tables |
| 33 | 33 | */ |
| 34 | - $this->middleware('add.lookup.tables:User', ['only' => ['create', 'edit']]); |
|
| 35 | - $this->middleware('add.lookup.tables:PageCategory', ['only' => ['create', 'edit']]); |
|
| 36 | - $this->middleware('add.published.at', ['only' => ['store', 'update']]); |
|
| 34 | + $this->middleware('add.lookup.tables:User', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 35 | + $this->middleware('add.lookup.tables:PageCategory', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 36 | + $this->middleware('add.published.at', [ 'only' => [ 'store', 'update' ] ]); |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Other tables |
| 40 | 40 | */ |
| 41 | - $this->middleware('media.image.select:Image', ['only' => ['create', 'edit']]); |
|
| 41 | + $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -124,15 +124,15 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * Validate page category ID, if failed set to default |
| 126 | 126 | */ |
| 127 | - if($request->has('pagecategory_id')){ |
|
| 128 | - $validIDs = []; |
|
| 127 | + if ($request->has('pagecategory_id')) { |
|
| 128 | + $validIDs = [ ]; |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * For each category |
| 132 | 132 | */ |
| 133 | 133 | foreach ($request->input('pagecategory_id') as $pagecategory_id) { |
| 134 | 134 | |
| 135 | - $arrayForValidator = ['pagecategory_id' => $pagecategory_id]; |
|
| 135 | + $arrayForValidator = [ 'pagecategory_id' => $pagecategory_id ]; |
|
| 136 | 136 | |
| 137 | 137 | $validator = Validator::make($arrayForValidator, [ |
| 138 | 138 | 'pagecategory_id' => 'required|integer|min:1|exists:pagecategory,id', |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | else { |
| 152 | 152 | |
| 153 | - $validIDs[] = $pagecategory_id; |
|
| 153 | + $validIDs[ ] = $pagecategory_id; |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * Add lookup tables |
| 34 | 34 | */ |
| 35 | - $this->middleware('add.lookup.tables:CommentStatus', ['only' => ['index','create','edit']]); |
|
| 35 | + $this->middleware('add.lookup.tables:CommentStatus', [ 'only' => [ 'index', 'create', 'edit' ] ]); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * Auto approve ? |
| 76 | 76 | */ |
| 77 | - if(env('AUTO_APPROVE_COMMENTS', 0) == 1){ |
|
| 77 | + if (env('AUTO_APPROVE_COMMENTS', 0) == 1) { |
|
| 78 | 78 | |
| 79 | 79 | $object->commentstatuses()->associate(2); |
| 80 | 80 | } |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * Manual approve |
| 84 | 84 | */ |
| 85 | - else{ |
|
| 85 | + else { |
|
| 86 | 86 | $object->commentstatuses()->associate(1); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
| 90 | - else{ |
|
| 90 | + else { |
|
| 91 | 91 | |
| 92 | 92 | $object->commentstatuses()->associate($request->input('commentstatus_id')); |
| 93 | 93 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @param Request $request |
| 148 | 148 | * @return Response |
| 149 | 149 | */ |
| 150 | - public function approve($id, Request $request){ |
|
| 150 | + public function approve($id, Request $request) { |
|
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | 153 | * Add ID to request |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param Request $request |
| 190 | 190 | * @return Response |
| 191 | 191 | */ |
| 192 | - public function spam($id, Request $request){ |
|
| 192 | + public function spam($id, Request $request) { |
|
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * Add ID to request |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * Add lookup tables |
| 33 | 33 | */ |
| 34 | - $this->middleware('add.lookup.tables:Slider', ['only' => ['index', 'create', 'edit']]); |
|
| 34 | + $this->middleware('add.lookup.tables:Slider', [ 'only' => [ 'index', 'create', 'edit' ] ]); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Other tables |
| 38 | 38 | */ |
| 39 | - $this->middleware('media.image.select:Image', ['only' => ['create', 'edit']]); |
|
| 39 | + $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |