@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | public function __construct() { |
| 30 | 30 | parent::__construct(); |
| 31 | 31 | |
| 32 | - $this->middleware('media.add.parameters', ['only' => ['store','update']]); |
|
| 33 | - $this->middleware('add.lookup.tables:ImageCategory', ['only' => ['index','create','edit']]); |
|
| 32 | + $this->middleware('media.add.parameters', [ 'only' => [ 'store', 'update' ] ]); |
|
| 33 | + $this->middleware('add.lookup.tables:ImageCategory', [ 'only' => [ 'index', 'create', 'edit' ] ]); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @var array |
| 59 | 59 | */ |
| 60 | - protected $binaryFields = ['image', 'image_mime_type', 'image_extension', |
|
| 61 | - 'image_original_name', 'image_size', 'image_width', 'image_height']; |
|
| 60 | + protected $binaryFields = [ 'image', 'image_mime_type', 'image_extension', |
|
| 61 | + 'image_original_name', 'image_size', 'image_width', 'image_height' ]; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Get number of pagination rows |
| 65 | 65 | * |
| 66 | 66 | * @return integer |
| 67 | 67 | */ |
| 68 | - public function getRowsToPaginate(){ |
|
| 68 | + public function getRowsToPaginate() { |
|
| 69 | 69 | |
| 70 | 70 | return env('ADMIN_MEDIA_PAGINATE', 12); |
| 71 | 71 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param object $object |
| 95 | 95 | * @param Request $request |
| 96 | 96 | */ |
| 97 | - public function associateRelationships($object, Request $request){ |
|
| 97 | + public function associateRelationships($object, Request $request) { |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * Validate category ID, if failed set to default |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | /** |
| 115 | 115 | * Validator OK - save it |
| 116 | 116 | */ |
| 117 | - else{ |
|
| 117 | + else { |
|
| 118 | 118 | |
| 119 | 119 | $object->imagecategories()->associate($request->input('imagecategory_id')); |
| 120 | 120 | } |
@@ -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 | |
@@ -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,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; |
@@ -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 | } |
@@ -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 | } |
| 29 | 29 | \ No newline at end of file |
@@ -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 | } |