Skip to content
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

Open
bkuhl opened this issue Aug 8, 2015 · 5 comments
Open

[Question] Using custom URL to serve S3 files #86

bkuhl opened this issue Aug 8, 2015 · 5 comments

Comments

@bkuhl
Copy link

bkuhl commented Aug 8, 2015

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.

@bkuhl
Copy link
Author

bkuhl commented Sep 30, 2015

Is this possible?

@Dylan-Buth
Copy link

Is there any answer to this? I'm interested as well.

@kyranb
Copy link

kyranb commented Feb 19, 2016

👍 This would be great. I'm looking to put my S3 assets behind a cache.

@tabennett
Copy link
Contributor

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.

@flyingL123
Copy link

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants