media->listFolderContents($folder) as $item) { if ($item->type === 'folder') { $this->resize($item->path); } else { Queue::push(ResizeJob::class, [$item->path]); } } } /** * Execute the console command. * @return void */ public function handle() { $this->media = MediaLibrary::instance(); ProgressBar::setFormatDefinition('custom', '%current%/%max% %bar% -- %message% (%size%)'); Storage::deleteDirectory('uploads/public/c'); foreach (Setting::get('folders') as $folder) { $this->resize($folder['folder']); } } /** * Get the console command arguments. * @return array */ protected function getArguments() { return []; } /** * Get the console command options. * @return array */ protected function getOptions() { return []; } }