diff --git a/packages/Webkul/API/Http/Resources/Catalog/Product.php b/packages/Webkul/API/Http/Resources/Catalog/Product.php index 765baa131..b694f2ea9 100644 --- a/packages/Webkul/API/Http/Resources/Catalog/Product.php +++ b/packages/Webkul/API/Http/Resources/Catalog/Product.php @@ -14,8 +14,6 @@ class Product extends JsonResource */ public function __construct($resource) { - $this->productImageHelper = app('Webkul\Product\Helpers\ProductImage'); - $this->productReviewHelper = app('Webkul\Product\Helpers\Review'); parent::__construct($resource); @@ -44,7 +42,7 @@ class Product extends JsonResource 'description' => $this->description, 'sku' => $this->sku, 'images' => ProductImage::collection($product->images), - 'base_image' => $this->productImageHelper->getProductBaseImage($product), + 'base_image' => app('Webkul\Product\ProductImage')->getProductBaseImage($product), 'variants' => Self::collection($this->variants), 'in_stock' => $product->haveSufficientQuantity(1), $this->mergeWhen($product->getTypeInstance()->isComposite(), [ diff --git a/packages/Webkul/BookingProduct/src/Type/Booking.php b/packages/Webkul/BookingProduct/src/Type/Booking.php index 0a876ae42..81766d7e1 100644 --- a/packages/Webkul/BookingProduct/src/Type/Booking.php +++ b/packages/Webkul/BookingProduct/src/Type/Booking.php @@ -9,7 +9,6 @@ use Webkul\BookingProduct\Helpers\Booking as BookingHelper; use Webkul\BookingProduct\Repositories\BookingProductRepository; use Webkul\Checkout\Models\CartItem; use Webkul\Product\Datatypes\CartItemValidationResult; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Repositories\ProductAttributeValueRepository; use Webkul\Product\Repositories\ProductImageRepository; use Webkul\Product\Repositories\ProductVideoRepository; @@ -56,7 +55,6 @@ class Booking extends Virtual * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\BookingProduct\Repositories\BookingProductRepository $bookingProductRepository * @param \Webkul\BookingProduct\Helpers\BookingHelper $bookingHelper * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository @@ -68,7 +66,6 @@ class Booking extends Virtual ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, - ProductImage $productImageHelper, BookingProductRepository $bookingProductRepository, BookingHelper $bookingHelper, ProductVideoRepository $productVideoRepository @@ -80,7 +77,6 @@ class Booking extends Virtual $attributeValueRepository, $productInventoryRepository, $productImageRepository, - $productImageHelper, $productVideoRepository ); diff --git a/packages/Webkul/Product/src/Helpers/ProductVideo.php b/packages/Webkul/Product/src/Helpers/ProductVideo.php index efab2e216..d325591e7 100644 --- a/packages/Webkul/Product/src/Helpers/ProductVideo.php +++ b/packages/Webkul/Product/src/Helpers/ProductVideo.php @@ -5,7 +5,7 @@ namespace Webkul\Product\Helpers; use Illuminate\Support\Facades\Storage; class ProductVideo extends AbstractProduct -{ +{ /** * Retrieve collection of videos * diff --git a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php index 7384af873..15f72d544 100755 --- a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php +++ b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php @@ -111,40 +111,4 @@ class ProductServiceProvider extends ServiceProvider return app()->make(ProductVideo::class); }); } - - /** - * Register facade - * - */ - public function registerFacadesd() - { - //to make the cart facade and bind the - //alias to the class needed to be called. - // $loader = AliasLoader::getInstance(); - - // $loader->alias('productimage', ProductImageFacade::class); - - // $this->app->singleton('productimage', function () { - // return new cart(); - // }); - - // $this->app->bind('productimage', 'Webkul\Checkout\Cart'); - - - // \App::bind('mysiteclass', function() - // { - // return new \Webkul\Product\Helpers\ProductImage; - // }); - - $this->app->bind('ProductImage', function() { - return new ProductImage; - }); - - // $loader = AliasLoader::getInstance(); - // $loader->alias('productimage', ProductImageFacade::class); - - // $this->app->singleton('productimage', function () { - // return app()->make(ProductImage::class); - // }); - } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index 76ef5491e..581b6e2cf 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -5,7 +5,6 @@ namespace Webkul\Product\Type; use Webkul\Checkout\Facades\Cart; use Webkul\Checkout\Models\CartItem; use Illuminate\Support\Facades\Storage; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Models\ProductAttributeValue; use Webkul\Product\Repositories\ProductRepository; use Webkul\Attribute\Repositories\AttributeRepository; @@ -59,13 +58,6 @@ abstract class AbstractType */ protected $productVideoRepository; - /** - * Product Image helper instance - * - * @var \Webkul\Product\Helpers\ProductImage - */ - protected $productImageHelper; - /** * Product model instance * @@ -148,7 +140,6 @@ abstract class AbstractType * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * * @return void @@ -159,7 +150,6 @@ abstract class AbstractType ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, - ProductImage $productImageHelper, ProductVideoRepository $productVideoRepository ) { $this->attributeRepository = $attributeRepository; @@ -172,8 +162,6 @@ abstract class AbstractType $this->productImageRepository = $productImageRepository; - $this->productImageHelper = $productImageHelper; - $this->productVideoRepository = $productVideoRepository; } diff --git a/packages/Webkul/Product/src/Type/Bundle.php b/packages/Webkul/Product/src/Type/Bundle.php index 4c8709763..1904474f2 100644 --- a/packages/Webkul/Product/src/Type/Bundle.php +++ b/packages/Webkul/Product/src/Type/Bundle.php @@ -11,7 +11,6 @@ use Webkul\Product\Repositories\ProductImageRepository; use Webkul\Product\Repositories\ProductVideoRepository; use Webkul\Product\Repositories\ProductBundleOptionRepository; use Webkul\Product\Repositories\ProductBundleOptionProductRepository; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Helpers\BundleOption; use Webkul\Checkout\Models\CartItem; @@ -88,7 +87,6 @@ class Bundle extends AbstractType * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository * @param \Webkul\Product\Repositories\ProductBundleOptionRepository $productBundleOptionRepository * @param \Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\Product\Helpers\BundleOption $bundleOptionHelper * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * @return void @@ -101,7 +99,6 @@ class Bundle extends AbstractType ProductImageRepository $productImageRepository, ProductBundleOptionRepository $productBundleOptionRepository, ProductBundleOptionProductRepository $productBundleOptionProductRepository, - ProductImage $productImageHelper, BundleOption $bundleOptionHelper, ProductVideoRepository $productVideoRepository ) @@ -112,7 +109,6 @@ class Bundle extends AbstractType $attributeValueRepository, $productInventoryRepository, $productImageRepository, - $productImageHelper, $productVideoRepository ); diff --git a/packages/Webkul/Product/src/Type/Downloadable.php b/packages/Webkul/Product/src/Type/Downloadable.php index e8cf7741f..2c553e49a 100644 --- a/packages/Webkul/Product/src/Type/Downloadable.php +++ b/packages/Webkul/Product/src/Type/Downloadable.php @@ -3,7 +3,6 @@ namespace Webkul\Product\Type; use Webkul\Checkout\Models\CartItem; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Repositories\ProductRepository; use Webkul\Attribute\Repositories\AttributeRepository; use Webkul\Product\Datatypes\CartItemValidationResult; @@ -80,7 +79,6 @@ class Downloadable extends AbstractType * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository * @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository * @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * * @return void @@ -93,7 +91,6 @@ class Downloadable extends AbstractType productImageRepository $productImageRepository, ProductDownloadableLinkRepository $productDownloadableLinkRepository, ProductDownloadableSampleRepository $productDownloadableSampleRepository, - ProductImage $productImageHelper, ProductVideoRepository $productVideoRepository ) { @@ -103,7 +100,6 @@ class Downloadable extends AbstractType $attributeValueRepository, $productInventoryRepository, $productImageRepository, - $productImageHelper, $productVideoRepository ); diff --git a/packages/Webkul/Product/src/Type/Grouped.php b/packages/Webkul/Product/src/Type/Grouped.php index 1f7f1c42d..5ec13f66a 100644 --- a/packages/Webkul/Product/src/Type/Grouped.php +++ b/packages/Webkul/Product/src/Type/Grouped.php @@ -9,7 +9,6 @@ use Webkul\Product\Repositories\ProductInventoryRepository; use Webkul\Product\Repositories\ProductImageRepository; use Webkul\Product\Repositories\ProductVideoRepository; use Webkul\Product\Repositories\ProductGroupedProductRepository; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Models\ProductAttributeValue; use Webkul\Product\Models\ProductFlat; @@ -59,7 +58,6 @@ class Grouped extends AbstractType * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository * @param \Webkul\Product\Repositories\ProductGroupedProductRepository $productGroupedProductRepository - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * @return void */ @@ -70,7 +68,6 @@ class Grouped extends AbstractType ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, ProductGroupedProductRepository $productGroupedProductRepository, - ProductImage $productImageHelper, ProductVideoRepository $productVideoRepository ) { @@ -80,7 +77,6 @@ class Grouped extends AbstractType $attributeValueRepository, $productInventoryRepository, $productImageRepository, - $productImageHelper, $productVideoRepository ); diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php b/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php index 4d5c1a356..d90951a41 100755 --- a/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php @@ -7,7 +7,6 @@ use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Webkul\Velocity\Helpers\Helper; -use Webkul\Product\Helpers\ProductImage; use Webkul\Product\Repositories\SearchRepository; use Webkul\Product\Repositories\ProductRepository; use Webkul\Customer\Repositories\WishlistRepository; @@ -26,13 +25,6 @@ class Controller extends BaseController */ protected $_config; - /** - * ProductImage object - * - * @var \Webkul\Product\Helpers\ProductImage - */ - protected $productImageHelper; - /** * SearchRepository object * @@ -87,18 +79,16 @@ class Controller extends BaseController * Create a new controller instance. * * @param \Webkul\Velocity\Helpers\Helper $velocityHelper - * @param \Webkul\Product\Helpers\ProductImage $productImageHelper * @param \Webkul\Product\Repositories\SearchRepository $searchRepository * @param \Webkul\Product\Repositories\ProductRepository $productRepository * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository * @param \Webkul\Velocity\Repositories\Product\ProductRepository $velocityProductRepository * @param \Webkul\Velocity\Repositories\VelocityCustomerCompareProductRepository $compareProductsRepository - * + * * @return void */ public function __construct( Helper $velocityHelper, - ProductImage $productImageHelper, SearchRepository $searchRepository, ProductRepository $productRepository, WishlistRepository $wishlistRepository, @@ -114,14 +104,12 @@ class Controller extends BaseController $this->productRepository = $productRepository; - $this->productImageHelper = $productImageHelper; - $this->categoryRepository = $categoryRepository; $this->wishlistRepository = $wishlistRepository; $this->velocityProductRepository = $velocityProductRepository; - + $this->compareProductsRepository = $compareProductsRepository; } }