@@ -9,10 +9,10 @@ |
||
| 9 | 9 | |
| 10 | 10 | class CouponService extends BaseService |
| 11 | 11 | { |
| 12 | - public function __construct(CouponRepository $coupon) |
|
| 13 | - { |
|
| 14 | - $this->repo = $coupon; |
|
| 15 | - } |
|
| 12 | + public function __construct(CouponRepository $coupon) |
|
| 13 | + { |
|
| 14 | + $this->repo = $coupon; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * The validation rules for the model. |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | 32 | if ($couponId) { |
| 33 | - $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
| 34 | - $rules['code'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
| 33 | + $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
| 34 | + $rules['code'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | return $rules; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | ); |
| 45 | 45 | |
| 46 | 46 | if ($groupId) { |
| 47 | - $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id'; |
|
| 47 | + $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id'; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $rules; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | if (isset($result->id)) { |
| 41 | 41 | Notification::success($successMsg); |
| 42 | - if(is_array($routeName)) { |
|
| 42 | + if (is_array($routeName)) { |
|
| 43 | 43 | return redirect()->route($routeName[0], $routeName[1]); |
| 44 | 44 | } |
| 45 | 45 | return redirect()->route($routeName); |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | function selectAllActiveByShopId($shopId) |
| 34 | 34 | { |
| 35 | - return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 35 | + return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -9,10 +9,10 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class FaqService extends BaseService |
| 11 | 11 | { |
| 12 | - public function __construct(FaqItemRepository $faq) |
|
| 13 | - { |
|
| 14 | - $this->repo = $faq; |
|
| 15 | - } |
|
| 12 | + public function __construct(FaqItemRepository $faq) |
|
| 13 | + { |
|
| 14 | + $this->repo = $faq; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * The validation rules for the model. |
@@ -67,6 +67,6 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function selectAllGroups() |
| 69 | 69 | { |
| 70 | - return $this->repo->selectAllGroups(); |
|
| 70 | + return $this->repo->selectAllGroups(); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | public function __construct(BrandRepository $brand) |
| 15 | 15 | { |
| 16 | 16 | $this->repo = $brand; |
| 17 | - $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/brand/"; |
|
| 18 | - $this->publicImagePath = public_path() .config('hideyo.public_path'). "/brand/"; |
|
| 17 | + $this->storageImagePath = storage_path().config('hideyo.storage_path')."/brand/"; |
|
| 18 | + $this->publicImagePath = public_path().config('hideyo.public_path')."/brand/"; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | 42 | if ($brandId) { |
| 43 | - $rules['title'] = $rules['title'].', '.$brandId.' = id'; |
|
| 43 | + $rules['title'] = $rules['title'].', '.$brandId.' = id'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $rules; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $attributes['extension'] = $attributes['file']->getClientOriginalExtension(); |
| 89 | 89 | $attributes['size'] = $attributes['file']->getSize(); |
| 90 | 90 | |
| 91 | - $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName())); |
|
| 91 | + $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName())); |
|
| 92 | 92 | $uploadSuccess = $attributes['file']->move($destinationPath, $filename); |
| 93 | 93 | |
| 94 | 94 | if ($uploadSuccess) { |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $this->model = $this->find($brandId); |
| 140 | 140 | |
| 141 | - if($this->model) { |
|
| 141 | + if ($this->model) { |
|
| 142 | 142 | $attributes['modified_by_user_id'] = auth('hideyobackend')->user()->id; |
| 143 | 143 | $image = $this->findImage($imageId); |
| 144 | 144 | $image->fill($attributes); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | { |
| 201 | 201 | $result = $this->repo->getModelImage()->get(); |
| 202 | 202 | $shop = ShopService::find($shopId); |
| 203 | - if($result AND $shop->thumbnail_square_sizes) { |
|
| 203 | + if ($result AND $shop->thumbnail_square_sizes) { |
|
| 204 | 204 | foreach ($result as $productImage) { |
| 205 | 205 | if ($shop->thumbnail_square_sizes) { |
| 206 | 206 | $sizes = explode(',', $shop->thumbnail_square_sizes); |
@@ -4,19 +4,19 @@ |
||
| 4 | 4 | |
| 5 | 5 | class BaseRepository |
| 6 | 6 | { |
| 7 | - public function selectAll() |
|
| 8 | - { |
|
| 9 | - return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get(); |
|
| 10 | - } |
|
| 7 | + public function selectAll() |
|
| 8 | + { |
|
| 9 | + return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get(); |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | 12 | public function selectAllByShopId($shopId) |
| 13 | 13 | { |
| 14 | - return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 14 | + return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function selectAllActiveByShopId($shopId) |
| 18 | 18 | { |
| 19 | - return $this->model->where('shop_id', '=', $shopId)->where('active', '=', 1)->get(); |
|
| 19 | + return $this->model->where('shop_id', '=', $shopId)->where('active', '=', 1)->get(); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function getModel() { |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ExceptionService extends BaseService |
| 9 | 9 | { |
| 10 | - public function __construct(ExceptionItemRepository $exception) |
|
| 11 | - { |
|
| 12 | - $this->repo = $exception; |
|
| 13 | - } |
|
| 10 | + public function __construct(ExceptionItemRepository $exception) |
|
| 11 | + { |
|
| 12 | + $this->repo = $exception; |
|
| 13 | + } |
|
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if ($clientId) { |
| 48 | - $rules['email'] = 'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id'; |
|
| 48 | + $rules['email'] = 'required|email|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$clientId.' = id'; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | return $rules; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | // create the validation rules ------------------------ |
| 162 | 162 | $rules = array( |
| 163 | - 'email' => 'required|email', // required and must be unique in the ducks table |
|
| 163 | + 'email' => 'required|email', // required and must be unique in the ducks table |
|
| 164 | 164 | 'password' => 'required', |
| 165 | 165 | 'firstname' => 'required', |
| 166 | 166 | 'lastname' => 'required', |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $client = $this->repo->checkEmailByShopId($attributes['email'], $shopId); |
| 181 | 181 | |
| 182 | - if($client AND $client->account_created) { |
|
| 182 | + if ($client AND $client->account_created) { |
|
| 183 | 183 | return false; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - if($client) { |
|
| 186 | + if ($client) { |
|
| 187 | 187 | $model = $client; |
| 188 | 188 | } else { |
| 189 | 189 | $model = $this->repo->getModel(); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $attributes['active'] = 0; |
| 195 | 195 | $attributes['confirmed'] = 0; |
| 196 | 196 | $attributes['confirmation_code'] = md5(uniqid(mt_rand(), true)); |
| 197 | - if($accountConfirmed) { |
|
| 197 | + if ($accountConfirmed) { |
|
| 198 | 198 | $attributes['active'] = 1; |
| 199 | 199 | $attributes['confirmed'] = 1; |
| 200 | 200 | $attributes['confirmation_code'] = null; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | { |
| 231 | 231 | $clientAddress = $this->repoAddress->find($addressId); |
| 232 | 232 | |
| 233 | - if($clientAddress) { |
|
| 233 | + if ($clientAddress) { |
|
| 234 | 234 | $clientAddress->fill($attributes); |
| 235 | 235 | $clientAddress->save(); |
| 236 | 236 | |