I have the following action in my repository:
public function getAsset($filename, $prefix = null, $directory = null)
{
if($directory) $directory = $directory;
$file = $directory . $prefix . $filename;
if($file) return $file;
return false;
}
This method will be responsible for returning a URL to an asset for use within my app. How can I easily build this URL? Does Flysystem come with a method for this? Checked the documentation and couldn't find anything.
The app user will have the ability to change the Filesystem on the fly via a settings panel, currently between Local & S3 and I would like the system to build the URL depending on what setting is set (I am using a custom settings module to inject the default into the Flysystem's config. This is working fine.
The paths will be as follows: local: storage/media/xxxx.jpg s3: bucketname/media/xxxx.jpg
Thanks in advance for any help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community