@@ -9,14 +9,14 @@ |
||
9 | 9 | |
10 | 10 | class PaymentMethodService extends BaseService |
11 | 11 | { |
12 | - public function __construct(PaymentMethodRepository $paymentMethod) |
|
13 | - { |
|
14 | - $this->repo = $paymentMethod; |
|
15 | - } |
|
12 | + public function __construct(PaymentMethodRepository $paymentMethod) |
|
13 | + { |
|
14 | + $this->repo = $paymentMethod; |
|
15 | + } |
|
16 | 16 | |
17 | 17 | public function selectOneByShopIdAndId($shopId, $paymentMethodId) |
18 | 18 | { |
19 | - $result = $this->repo->selectOneByShopIdAndId($shopId, $paymentMethodId); |
|
19 | + $result = $this->repo->selectOneByShopIdAndId($shopId, $paymentMethodId); |
|
20 | 20 | |
21 | 21 | if ($result->isEmpty()) { |
22 | 22 | return false; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | ); |
40 | 40 | |
41 | 41 | if ($paymentMethodId) { |
42 | - $rules['title'] = $rules['title'].','.$paymentMethodId.' = id'; |
|
42 | + $rules['title'] = $rules['title'].','.$paymentMethodId.' = id'; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return $rules; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | protected $table = 'payment_method'; |
16 | 16 | |
17 | 17 | // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model. |
18 | - protected $fillable = ['total_price_discount_type', 'total_price_discount_value', 'total_price_discount_start_date', 'total_price_discount_end_date', 'active', 'percent_of_total', 'price', 'no_price_from', 'payment_external', 'title', 'shop_id', 'tax_rate_id', 'mollie_external_payment_way', 'order_confirmed_order_status_id', 'payment_completed_order_status_id', 'payment_failed_order_status_id', 'mollie_api_key', 'modified_by_user_id']; |
|
18 | + protected $fillable = ['total_price_discount_type', 'total_price_discount_value', 'total_price_discount_start_date', 'total_price_discount_end_date', 'active', 'percent_of_total', 'price', 'no_price_from', 'payment_external', 'title', 'shop_id', 'tax_rate_id', 'mollie_external_payment_way', 'order_confirmed_order_status_id', 'payment_completed_order_status_id', 'payment_failed_order_status_id', 'mollie_api_key', 'modified_by_user_id']; |
|
19 | 19 | |
20 | 20 | public function getPriceDetails() |
21 | 21 | { |
@@ -29,7 +29,7 @@ |
||
29 | 29 | ); |
30 | 30 | |
31 | 31 | if ($id) { |
32 | - $rules['name'] = 'required|between:4,65|unique_with:general_setting, shop_id, '.$id.' = id'; |
|
32 | + $rules['name'] = 'required|between:4,65|unique_with:general_setting, shop_id, '.$id.' = id'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return $rules; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | $instance = new static; |
21 | 21 | |
22 | - $query = $instance->where($saveTo, 'LIKE', $slug . '%'); |
|
22 | + $query = $instance->where($saveTo, 'LIKE', $slug.'%'); |
|
23 | 23 | |
24 | 24 | // @overriden - changed this to scope unique slugs per user |
25 | 25 | $query = $query->where('shop_id', $this->shop_id); |
@@ -9,17 +9,17 @@ |
||
9 | 9 | |
10 | 10 | class GeneralSettingService extends BaseService |
11 | 11 | { |
12 | - public function __construct(GeneralSettingRepository $generalSetting) |
|
13 | - { |
|
14 | - $this->repo = $generalSetting; |
|
15 | - } |
|
16 | - |
|
17 | - /** |
|
18 | - * The validation rules for the model. |
|
19 | - * |
|
20 | - * @param integer $settingId id attribute model |
|
21 | - * @return array |
|
22 | - */ |
|
12 | + public function __construct(GeneralSettingRepository $generalSetting) |
|
13 | + { |
|
14 | + $this->repo = $generalSetting; |
|
15 | + } |
|
16 | + |
|
17 | + /** |
|
18 | + * The validation rules for the model. |
|
19 | + * |
|
20 | + * @param integer $settingId id attribute model |
|
21 | + * @return array |
|
22 | + */ |
|
23 | 23 | public function rules($settingId = false) |
24 | 24 | { |
25 | 25 | $rules = array( |
@@ -28,7 +28,7 @@ |
||
28 | 28 | ); |
29 | 29 | |
30 | 30 | if ($settingId) { |
31 | - $rules['name'] = $rules['name'].','.$settingId.' = id'; |
|
31 | + $rules['name'] = $rules['name'].','.$settingId.' = id'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | return $rules; |
@@ -13,5 +13,5 @@ |
||
13 | 13 | */ |
14 | 14 | protected $table = 'general_setting'; |
15 | 15 | |
16 | - protected $fillable = ['id', 'name', 'value', 'text_value', 'shop_id']; |
|
16 | + protected $fillable = ['id', 'name', 'value', 'text_value', 'shop_id']; |
|
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -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 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | ); |
32 | 32 | |
33 | 33 | if ($couponId) { |
34 | - $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
35 | - $rules['code'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
34 | + $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
35 | + $rules['code'] = 'required|between:4,65|unique_with:'.$this->repo->getModel()->getTable().', shop_id, '.$couponId.' = id'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $rules; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | |
48 | 48 | if ($groupId) { |
49 | - $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id'; |
|
49 | + $rules['title'] = 'required|between:4,65|unique_with:'.$this->repo->getGroupModel()->getTable().', shop_id, '.$groupId.' = id'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | return $rules; |
39 | 39 | } |
40 | 40 | |
41 | - public function __construct(ProductCategoryRepository $productCategory) |
|
42 | - { |
|
43 | - $this->repo = $productCategory; |
|
41 | + public function __construct(ProductCategoryRepository $productCategory) |
|
42 | + { |
|
43 | + $this->repo = $productCategory; |
|
44 | 44 | $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product_category/"; |
45 | 45 | $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product_category/"; |
46 | - } |
|
46 | + } |
|
47 | 47 | |
48 | 48 | public function create(array $attributes) |
49 | 49 | { |
@@ -286,22 +286,22 @@ discard block |
||
286 | 286 | |
287 | 287 | public function selectOneByShopIdAndSlug($shopId, $slug, $imageTag = false) |
288 | 288 | { |
289 | - return $this->repo->selectOneByShopIdAndSlug($shopId, $slug, $imageTag); |
|
289 | + return $this->repo->selectOneByShopIdAndSlug($shopId, $slug, $imageTag); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | public function selectAllByShopIdAndRoot($shopId) |
293 | 293 | { |
294 | - return $this->repo->selectAllByShopIdAndRoot($shopId); |
|
294 | + return $this->repo->selectAllByShopIdAndRoot($shopId); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | public function selectRootCategories($shopId, $imageTag) |
298 | 298 | { |
299 | - return $this->repo->selectRootCategories($shopId, $imageTag); |
|
299 | + return $this->repo->selectRootCategories($shopId, $imageTag); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | public function selectCategoriesByParentId($shopId, $parentId, $imageTag = false) |
303 | 303 | { |
304 | - return $this->repo->selectCategoriesByParentId($shopId, $parentId, $imageTag); |
|
304 | + return $this->repo->selectCategoriesByParentId($shopId, $parentId, $imageTag); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | public function selectAllProductPullDown() |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ); |
33 | 33 | |
34 | 34 | if ($productCategoryId) { |
35 | - $rules['title'] = 'required|between:4,65|unique_with:'.'product_category, shop_id, '.$productCategoryId.' = id'; |
|
35 | + $rules['title'] = 'required|between:4,65|unique_with:'.'product_category, shop_id, '.$productCategoryId.' = id'; |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | return $rules; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | public function __construct(ProductCategoryRepository $productCategory) |
42 | 42 | { |
43 | 43 | $this->repo = $productCategory; |
44 | - $this->storageImagePath = storage_path() .config('hideyo.storage_path'). "/product_category/"; |
|
45 | - $this->publicImagePath = public_path() .config('hideyo.public_path'). "/product_category/"; |
|
44 | + $this->storageImagePath = storage_path().config('hideyo.storage_path')."/product_category/"; |
|
45 | + $this->publicImagePath = public_path().config('hideyo.public_path')."/product_category/"; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function create(array $attributes) |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | if ($validator->fails()) { |
149 | 149 | return $validator; |
150 | 150 | } else { |
151 | - $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName())); |
|
151 | + $filename = str_replace(" ", "_", strtolower($attributes['file']->getClientOriginalName())); |
|
152 | 152 | $uploadSuccess = $attributes['file']->move($destinationPath, $filename); |
153 | 153 | |
154 | 154 | if ($uploadSuccess) { |
@@ -242,9 +242,9 @@ discard block |
||
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
245 | - $directory = storage_path() . "/app/files/product_category/".$this->model->id; |
|
245 | + $directory = storage_path()."/app/files/product_category/".$this->model->id; |
|
246 | 246 | File::deleteDirectory($directory); |
247 | - File::deleteDirectory(public_path() . "/files/product_category/".$this->model->id); |
|
247 | + File::deleteDirectory(public_path()."/files/product_category/".$this->model->id); |
|
248 | 248 | |
249 | 249 | if ($this->model->children()->count()) { |
250 | 250 | foreach ($this->model->children()->get() as $child) { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | public function destroyImage($imageId) |
261 | 261 | { |
262 | 262 | $this->imageModel = $this->findImage($imageId); |
263 | - $filename = storage_path() ."/app/files/product_category/".$this->imageModel->product_category_id."/".$this->imageModel->file; |
|
263 | + $filename = storage_path()."/app/files/product_category/".$this->imageModel->product_category_id."/".$this->imageModel->file; |
|
264 | 264 | $shopId = auth('hideyobackend')->user()->selected_shop_id; |
265 | 265 | $shop = ShopService::find($shopId); |
266 | 266 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $sizes = explode(',', $shop->thumbnail_square_sizes); |
271 | 271 | if ($sizes) { |
272 | 272 | foreach ($sizes as $key => $value) { |
273 | - File::delete(public_path() . "/files/product_category/".$value."/".$this->imageModel->product_category_id."/".$this->imageModel->file); |
|
273 | + File::delete(public_path()."/files/product_category/".$value."/".$this->imageModel->product_category_id."/".$this->imageModel->file); |
|
274 | 274 | } |
275 | 275 | } |
276 | 276 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | */ |
14 | 14 | protected $table = 'product_category_image'; |
15 | 15 | |
16 | - protected $guarded = array('file'); |
|
16 | + protected $guarded = array('file'); |
|
17 | 17 | |
18 | 18 | // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model. |
19 | - protected $fillable = ['product_category_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id',]; |
|
19 | + protected $fillable = ['product_category_id', 'file', 'extension', 'size', 'path', 'rank', 'tag', 'modified_by_user_id', ]; |
|
20 | 20 | } |
21 | 21 | \ No newline at end of file |