'buildTemporaryUrlsUsing does not exist on laravel storage facade

I'm using local storage and s3 so would like to use temporary urls, I know I can't use them on the local disk so found on the docs that you can override that function for the local disk in the AppServiceProvider, I am on laravel 8.22 however am getting a error shown below:

Call to undefined method League\Flysystem\Filesystem::buildTemporaryUrlsUsing

The code I'm attempting to use:

Storage::disk('local')->buildTemporaryUrlsUsing(function ($path, $expiration, $options) {
    return URL::temporarySignedRoute(
        'files.download',
        $expiration,
        array_merge($options, ['path' => $path])
    );
});

https://laravel.com/docs/8.x/filesystem#temporary-urls



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source