@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | |
13 | 13 | class ClientService extends BaseService |
14 | 14 | { |
15 | - public function __construct(ClientRepository $client, ClientAddressRepository $clientAddress) |
|
16 | - { |
|
17 | - $this->repo = $client; |
|
18 | - $this->repoAddress = $clientAddress; |
|
19 | - } |
|
15 | + public function __construct(ClientRepository $client, ClientAddressRepository $clientAddress) |
|
16 | + { |
|
17 | + $this->repo = $client; |
|
18 | + $this->repoAddress = $clientAddress; |
|
19 | + } |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * The validation rules for the model. |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | public function validateConfirmationCode($confirmationCode, $email, $shopId) |
99 | 99 | { |
100 | - return $this->repo->validateConfirmationCodeByConfirmationCodeAndEmail($confirmationCode, $email, $shopId); |
|
101 | - } |
|
100 | + return $this->repo->validateConfirmationCodeByConfirmationCodeAndEmail($confirmationCode, $email, $shopId); |
|
101 | + } |
|
102 | 102 | |
103 | 103 | public function validateLogin($attributes) |
104 | 104 | { |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | $client = $this->repo->checkEmailByShopId($attributes['email'], $shopId); |
167 | 167 | |
168 | 168 | if($client AND $client->account_created) { |
169 | - return false; |
|
169 | + return false; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if($client) { |
173 | - $model = $client; |
|
173 | + $model = $client; |
|
174 | 174 | } else { |
175 | - $model = $this->repo->getModel(); |
|
175 | + $model = $this->repo->getModel(); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | $attributes['shop_id'] = $shopId; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | public function createAddress($attributes, $clientId) |
206 | 206 | { |
207 | 207 | $attributes['client_id'] = $clientId; |
208 | - $model = $this->repoAddress->getModel(); |
|
208 | + $model = $this->repoAddress->getModel(); |
|
209 | 209 | $model->fill($attributes); |
210 | 210 | $model->save(); |
211 | 211 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | |
48 | 48 | if ($clientId) { |
49 | - $rules['email'] = 'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id'; |
|
49 | + $rules['email'] = 'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $rules; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | // create the validation rules ------------------------ |
148 | 148 | $rules = array( |
149 | - 'email' => 'required|email', // required and must be unique in the ducks table |
|
149 | + 'email' => 'required|email', // required and must be unique in the ducks table |
|
150 | 150 | 'password' => 'required', |
151 | 151 | 'firstname' => 'required', |
152 | 152 | 'lastname' => 'required', |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | { |
166 | 166 | $client = $this->repo->checkEmailByShopId($attributes['email'], $shopId); |
167 | 167 | |
168 | - if($client AND $client->account_created) { |
|
168 | + if ($client AND $client->account_created) { |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
172 | - if($client) { |
|
172 | + if ($client) { |
|
173 | 173 | $model = $client; |
174 | 174 | } else { |
175 | 175 | $model = $this->repo->getModel(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $attributes['active'] = 0; |
181 | 181 | $attributes['confirmed'] = 0; |
182 | 182 | $attributes['confirmation_code'] = md5(uniqid(mt_rand(), true)); |
183 | - if($accountConfirmed) { |
|
183 | + if ($accountConfirmed) { |
|
184 | 184 | $attributes['active'] = 1; |
185 | 185 | $attributes['confirmed'] = 1; |
186 | 186 | $attributes['confirmation_code'] = null; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | $clientAddress = $this->repoAddress->find($addressId); |
219 | 219 | |
220 | - if($clientAddress) { |
|
220 | + if ($clientAddress) { |
|
221 | 221 | $clientAddress->fill($attributes); |
222 | 222 | $clientAddress->save(); |
223 | 223 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | public function selectAllByClientId($clientId) |
20 | 20 | { |
21 | - return $this->model->where('client_id', '=', $clientId)->get(); |
|
21 | + return $this->model->where('client_id', '=', $clientId)->get(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function selectOneByClientIdAndId($clientId, $id) |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | $shop = ShopService::checkByUrl(config()->get('app.url')); |
23 | 23 | |
24 | - if(!$shop) { |
|
24 | + if (!$shop) { |
|
25 | 25 | abort(404, "shop cannot be found"); |
26 | 26 | } |
27 | 27 |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | |
11 | 11 | class AttributeService extends BaseService |
12 | 12 | { |
13 | - public function __construct(AttributeRepository $attribute, AttributeGroupRepository $attributeGroup) |
|
14 | - { |
|
15 | - $this->repo = $attribute; |
|
16 | - $this->repoGroup = $attributeGroup; |
|
17 | - } |
|
13 | + public function __construct(AttributeRepository $attribute, AttributeGroupRepository $attributeGroup) |
|
14 | + { |
|
15 | + $this->repo = $attribute; |
|
16 | + $this->repoGroup = $attributeGroup; |
|
17 | + } |
|
18 | 18 | |
19 | 19 | private function rules($id = false) |
20 | 20 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $attributes['shop_id'] = auth('hideyobackend')->user()->selected_shop_id; |
48 | 48 | $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id; |
49 | - $attributes['attribute_group_id'] = $attributeGroupId; |
|
49 | + $attributes['attribute_group_id'] = $attributeGroupId; |
|
50 | 50 | |
51 | 51 | $validator = Validator::make($attributes, $this->rules()); |
52 | 52 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | ); |
37 | 37 | |
38 | 38 | if ($id) { |
39 | - $rules['title'] = $rules['title'].','.$id.' = id'; |
|
39 | + $rules['title'] = $rules['title'].','.$id.' = id'; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return $rules; |
@@ -10,13 +10,13 @@ |
||
10 | 10 | |
11 | 11 | class ProductAmountSeriesService extends BaseService |
12 | 12 | { |
13 | - public function __construct(ProductAmountSeriesRepository $productAmountSeries) |
|
14 | - { |
|
15 | - $this->repo = $productAmountSeries; |
|
16 | - } |
|
13 | + public function __construct(ProductAmountSeriesRepository $productAmountSeries) |
|
14 | + { |
|
15 | + $this->repo = $productAmountSeries; |
|
16 | + } |
|
17 | 17 | |
18 | 18 | |
19 | - /** |
|
19 | + /** |
|
20 | 20 | * The validation rules for the model. |
21 | 21 | * |
22 | 22 | * @param integer $id id attribute model |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | |
25 | 25 | $storageImagePath = "/files/product/"; |
26 | - $publicImagePath = public_path() .config('hideyo.public_path'). "/product/"; |
|
26 | + $publicImagePath = public_path().config('hideyo.public_path')."/product/"; |
|
27 | 27 | |
28 | 28 | |
29 | 29 | $productCategory = ProductCategory::where('title', '=', 'Pants')->first(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $product2->product_category_id = $productCategory->id; |
133 | 133 | $product2->tax_rate_id = $taxRate->id; |
134 | 134 | |
135 | - if (! $product2->save()) { |
|
135 | + if (!$product2->save()) { |
|
136 | 136 | \Log::info('Unable to create product '.$product2->title, (array)$product2->errors()); |
137 | 137 | } else { |
138 | 138 | \Log::info('Created product "'.$product2->title.'" <'.$product2->title.'>'); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | public function orderProductsByClientId($clientId, $shopId) |
77 | 77 | { |
78 | - return $this->modelOrderProduct->with(array('product'))->whereHas('Order', function ($query) use ($clientId, $shopId) { |
|
78 | + return $this->modelOrderProduct->with(array('product'))->whereHas('Order', function($query) use ($clientId, $shopId) { |
|
79 | 79 | $query->where('client_id', '=', $clientId)->where('shop_id', '=', $shopId); |
80 | 80 | }); |
81 | 81 | } |
@@ -13,10 +13,10 @@ |
||
13 | 13 | |
14 | 14 | class OrderService extends BaseService |
15 | 15 | { |
16 | - public function __construct(OrderRepository $order) |
|
17 | - { |
|
18 | - $this->repo = $order; |
|
19 | - } |
|
16 | + public function __construct(OrderRepository $order) |
|
17 | + { |
|
18 | + $this->repo = $order; |
|
19 | + } |
|
20 | 20 | |
21 | 21 | public function createAddress(array $attributes, $orderId) |
22 | 22 | { |
@@ -109,7 +109,7 @@ |
||
109 | 109 | { |
110 | 110 | $attributes['shop_id'] = $shopId; |
111 | 111 | $attributes['client_id'] = $attributes['user_id']; |
112 | - $client = ClientService::selectOneByShopIdAndId($shopId, $attributes['user_id']); |
|
112 | + $client = ClientService::selectOneByShopIdAndId($shopId, $attributes['user_id']); |
|
113 | 113 | |
114 | 114 | $this->repo->getModel()->fill($attributes); |
115 | 115 | $this->repo->getModel()->save(); |