@@ -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 | |
@@ -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 | /** |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | $ga = $this->getGAValues(); |
| 78 | 78 | } else { |
| 79 | 79 | |
| 80 | - $ga = []; |
|
| 80 | + $ga = [ ]; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $statistics = [ |
| 84 | 84 | 'ga' => $ga |
| 85 | 85 | ]; |
| 86 | 86 | |
| 87 | - return view('admin.modules.dashboard.index', ['statistics' => $statistics]); |
|
| 87 | + return view('admin.modules.dashboard.index', [ 'statistics' => $statistics ]); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Get the data |
| 101 | 101 | */ |
| 102 | - $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 102 | + $data = \Analytics::getVisitorsAndPageViews($days); |
|
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * Calculate total |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $total = 0; |
| 108 | 108 | foreach ($data as $value) { |
| 109 | 109 | |
| 110 | - $total += $value[$type]; |
|
| 110 | + $total += $value[ $type ]; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | return $total; |
@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -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 | /** |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Other tables |
| 31 | 31 | */ |
| 32 | - $this->middleware('media.image.select:Image', ['only' => ['create','edit']]); |
|
| 32 | + $this->middleware('media.image.select:Image', [ 'only' => [ 'create', 'edit' ] ]); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param object $object |
| 51 | 51 | * @param Request $request |
| 52 | 52 | */ |
| 53 | - public function associateRelationships($object, Request $request){ |
|
| 53 | + public function associateRelationships($object, Request $request) { |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * Validate image ID, if failed set to default |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * Validator OK - save it |
| 71 | 71 | */ |
| 72 | - else{ |
|
| 72 | + else { |
|
| 73 | 73 | |
| 74 | 74 | $object->images()->associate($request->input('image_id')); |
| 75 | 75 | } |
@@ -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 |