protected function file(array $attributes, $path)
    {
        $filesystem = new Filesystem;

        $file = new UploadedFile(
            $path,
            last(explode('/', $path)),
            $filesystem->mimeType($path),
            $filesystem->size($path),
            null, // error
            true
        );

        if (count($attributes)) {
            return collect(array_merge(compact('file'), $attributes));
        }

        return $file;
    }