ctf0

how to change img url through middleware

Posted 2 years ago by ctf0

so lets say u have an img over s3, which when used with

Storage::disk('s3')->url($img->link)

you would get something like

https://s3-us-west-2.amazonaws.com/bucket_name/123.jpg

and now i started using cloudfront and cuz the CNAME thing is not working and gives errors, so i was thinking of making a middleware that auto change that url to something else like

https://xxxx.cloudfront.net/123.jpg

so is that possible ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.