/** * Fire the command. * * @param FileRepositoryInterface $files */ public function fire(FileRepositoryInterface $files) { $missing = false; /* @var FileInterface|EloquentModel $file */ foreach ($files->all() as $file) { if (!$file->resource()) { $missing = true; if (!$this->option('pretend')) { $files->delete($file); } $this->info($file->path() . ' ' . (!$this->option('pretend') ? 'deleted' : 'missing') . '.'); } } if (!$missing) { $this->info('Files database is clean.'); } }