'Assign a name to disk on-demand of laravel, to be used on spatie media library

image of code

I want to create a disk on demand and use it to store data on S3, the reason why; is that I have to change the bucket each time, and also I have two types of buckets ( private and public )

as you can see in the picture above, I want to create the disk and then use it directly



Sources

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

Source: Stack Overflow

Solution Source