DigitalOcean Spaces with Laravel

An overview of how to use DigitalOcean Spaces (Object Storage) with Laravel. We build an app that uploads to our local file storage, then setup DigitalOcean Spaces to upload files to the cloud.

GitHub repo: https://github.com/drehimself/laravel-spaces-example

# LINKS
My courses: https://codewithdre.com
Sign up for my newsletter: http://andremadarang.com/newsletter
My website: http://andremadarang.com
Twitter: http://twitter.com/drehimself
GitHub: http://github.com/drehimself
CodePen: http://codepen.io/drehimself

Comments

Hamid Hosseini says:

This doesn’t work. Laravel keeps saying “Endpoints must be full URIs and include a scheme and host”

Kamran Hossain says:

Thanks, Andre. I am searching a video like this. There is one question. Do I need to put the driver name s3 for DigitalOcean Spaces? Will I need an AWS s3 account or any connection with Amazon for this?

Pablo Torres says:

Hi Andre, I hope you can help me out…
To upload this works…

$imaged_card = Image::make($image_card_original_name)
->resize(100, 60)
->encode(‘jpg’, 80);
Storage::put(
‘images/article-one’,
$imaged_card->__toString(),
‘public’
);

But trying deleting a file or folder DigitalOcean is not happy. I guess I have to pass something like the ‘permission’, any suggestion?
Storage::deleteDirectory(
$directory
);

Thanks…

Bernard Onigbinde says:

Best and simplest laravel file upload video I’ve ever seen. Also helped me set up spaces. 😉
This helped me so so so much! Thanks a million!

Michael S says:

Wow thank you, i have learned so much from your tutorials, i have a question let say you setup a task scheduler and the image delete once a week. Does the image delete from digital ocean as well?

codegeek1001 says:

Thx. This helped a lot. Any tips on how to set CORS response headers to access the file through an xhr request from a different domain ?

peti ibhuzah says:

this is what i wanted thanks so much please make the full project

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!