S3 Support
sujitrulz opened this issue · comments
Sujit mourya commented
Hi @Stolz,
Is it possible to add files to s3 and fetch the file directly from s3 in blade file?
Javi commented
If you are using the pipeline in theory it would be possible to retrieve the files from S3. If you take a look at the docs you'll see there is the fetch_command
config option which accepts a closure that receives as first parameter the path of the asset to be pipelined. Simply add the logic for fetching files from S3 into that closure and make sure it returns the content of the asset.
For instance, assuming your Laravel S3 disk is properly configured:
// File: config/assets.php
return [
/*...*/
'fetch_command' = function ($asset) {
return \Storage::disk('s3')->get($asset);
},
/*...*/
];