Exemple #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  * @throws Exception
  */
 public function handle()
 {
     $image = Image::findOrFail($this->argument('imageId'));
     if (!empty($image->thumbnailImageFileId)) {
         if (!$this->option('regenerate')) {
             throw new Exception("Image already has a thumbnail and --regenerate was not set");
         }
         $thumbnail = $image->getThumbnailImageFile();
         \Queue::connection('sync')->push(new DeleteFileJob($thumbnail->getPath()));
         $thumbnail->delete(false);
     }
     \Queue::connection('sync')->push(new MakeThumbnailJob($image->getImageFile()));
 }
Exemple #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $image = Image::findOrFail($this->argument('imageId'));
     var_dump($image->delete());
 }