Question
How to generate DigitalOcean Spaces CDN url on Laravel ?
Hello,
I am using Storage class for getting file url like this;
Storage::disk('doSpaces')->url('uploads/file/'.$this->exampleAttribute);
//This gives : mybucketname.ams3.digitaloceanspaces.com/uploads/file/1546429522.jpg
But I dont want orginal file url, I wanna CDN file url like this ;
mybucketname.ams3.cdn.digitaloceanspaces.com/uploads/file/1546429522.jpg
I prefer clean code instead of string manipulation
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×