File: D:/HostingSpaces/blijegasten/blijegasten.be/app/Console/Commands/RecalculateProductImages.php
<?php
namespace App\Console\Commands;
use App\Komma\Shop\Products\Product\Transfer\ProductDocumentImporterService;
use Illuminate\Console\Command;
class RecalculateProductImages extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'kms:recalculate-product-images';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Recalculated the product images';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function handle()
{
$productDocumentImportService = app()->make(ProductDocumentImporterService::class);
$this->info('Remove resized images...');
$productDocumentImportService->removeResizedImagesAndRemoveTimestamp();
$this->info('Finished removing...');
$this->info('Start import...');
$productDocumentImportService->importDocuments(true);
$this->info('Finished import...');
}
}