-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Using custom URL to serve S3 files #86
Comments
Is this possible? |
Is there any answer to this? I'm interested as well. |
👍 This would be great. I'm looking to put my S3 assets behind a cache. |
There's currently no way to do this that I know of. It might be possible in the future, but Stapler wasn't built with this type of customization in mind. |
As a workaround, how about adding a method to your model: public function imageUrl($style = null) {
return preg_replace('/s3\.amazonaws\.com\/mybucketname/', "assets.mysite.com", $this->image->url($style), 1);
} Then just call this method to get your attachment url with custom domain: $model->imageUrl('thumbnail'); |
I have my files accessible via
assets.mysite.com
on S3 and would like to serve the files from there, rather than the out of the box URL that stapler generates. Is it possible to do this? I don't see any URL customization options in the s3 config.The text was updated successfully, but these errors were encountered: