removed productimage and productvideo helper
This commit is contained in:
parent
63b8da2c46
commit
24afa07e66
|
|
@ -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(), [
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace Webkul\Product\Helpers;
|
|||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ProductVideo extends AbstractProduct
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Retrieve collection of videos
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue