Plank\Mediable\Commands\PruneMediaCommand::handle PHP Метод

handle() публичный Метод

Execute the console command.
public handle ( ) : void
Результат void
    public function handle()
    {
        $disk = $this->argument('disk');
        $directory = $this->option('directory') ?: '';
        $recursive = !$this->option('non-recursive');
        $counter = 0;
        $records = Media::inDirectory($disk, $directory, $recursive)->get();
        foreach ($records as $media) {
            if (!$media->fileExists()) {
                $media->delete();
                ++$counter;
                $this->info("Pruned record for file {$media->getDiskPath()}", 'v');
            }
        }
        $this->info("Pruned {$counter} record(s).");
    }
PruneMediaCommand