Question

Config DO Spaces in Laravel 11 doesn't work 🤨

Hello !

I have a trouble with the configuration of my DigitalOcean space in my Laravel application. I created a fresh new blank project with laravel new but the problem still here.

So this is my config : .env

DO_ACCESS_KEY_ID=MY_KEY
DO_SECRET_ACCESS_KEY=MY_SECRET_KEY
DO_DEFAULT_REGION=FRA1
DO_BUCKET=nody
DO_ENDPOINT=https://nody.fra1.digitaloceanspaces.com

filesystem.php

'do' => [
  'driver' => 's3',
  'key' => env('DO_ACCESS_KEY_ID'),
  'secret' => env('DO_SECRET_ACCESS_KEY'),
  'region' => env('DO_DEFAULT_REGION'),
  'bucket' => env('DO_BUCKET'),
  'endpoint' => env('DO_ENDPOINT'),
],

Then I modify my route to make a basic test :

Route::get('/', function () {
    Storage::disk('do')->put('test.txt', 'Hello, DigitalOcean Spaces!');
    return view('welcome');
});

(Yes I have install “league/flysystem-aws-s3-v3” package) Nothing happen and I don’t know how I can get feedback on what’s going on under the hood :(


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
• June 30, 2024
Accepted Answer

Heya, @thomasdl

Ensure your .env file contains the correct environment variables:

DO_ACCESS_KEY_ID=YOUR_KEY 
DO_SECRET_ACCESS_KEY=YOUR_SECRET_KEY 
DO_DEFAULT_REGION=fra1 
DO_BUCKET=nody 
DO_ENDPOINT=https://fra1.digitaloceanspaces.com

Note: DO_ENDPOINT should not include the bucket name, just the base URL for the region.

Let us know how it goes!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.