Plank\Mediable\Commands\ImportMediaCommand::createRecordForFile PHP Method

createRecordForFile() protected method

Generate a new media record.
protected createRecordForFile ( string $disk, string $path ) : void
$disk string
$path string
return void
    protected function createRecordForFile($disk, $path)
    {
        try {
            $this->uploader->importPath($disk, $path);
            ++$this->counters['created'];
            $this->info("Created Record for file at {$path}", 'v');
        } catch (MediaUploadException $e) {
            $this->warn($e->getMessage(), 'vvv');
            ++$this->counters['skipped'];
            $this->info("Skipped file at {$path}", 'v');
        }
    }