HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/blije-gasten.komma.pro/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...');

    }
}