protonemedia / laravel-ffmpeg

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
https://protone.media/en/blog/how-to-use-ffmpeg-in-your-laravel-projects
MIT License
1.63k stars 194 forks source link

Too few arguments to function FilesystemAdapter::setVisibility() #458

Open ateamcms opened 1 year ago

ateamcms commented 1 year ago

Hello, get error in line https://github.com/protonemedia/laravel-ffmpeg/blob/main/src/Filesystem/Media.php#L151

With forwards call to FilesystemAdapter method setVisibility expect 2 arguments ($path and $visibility), but in your code you pass only $visibility (but in previous method in Media.php, called copyAllFromTemporaryDirectory you pass two arguments and it's work).

Can you please fix that method with something like this?

public function setVisibility(string $path, string $visibility = null)
{
    $disk = $this->getDisk();

    if ($visibility && $disk->isLocalDisk()) {
        $disk->setVisibility($path, $visibility);
    }

    return $this;
}

and this in https://github.com/protonemedia/laravel-ffmpeg/blob/main/src/Exporters/MediaExporter.php#L242

if ($outputMedia) {
    $outputMedia->copyAllFromTemporaryDirectory($this->visibility);
    $outputMedia->setVisibility($path, $this->visibility);
}

Laravel 9.45.0 PHP 8.1 laravel-ffmpeg 8.2.0

Thank you

kslr commented 1 year ago

same issue