@@ -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 |
@@ -86,8 +86,7 @@ |
||
86 | 86 | $object->commentstatuses()->associate(1); |
87 | 87 | } |
88 | 88 | |
89 | - } |
|
90 | - else{ |
|
89 | + } else{ |
|
91 | 90 | |
92 | 91 | $object->commentstatuses()->associate($request->input('commentstatus_id')); |
93 | 92 | } |
@@ -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 |
@@ -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); |