Cannot get spaces to work with Laravel

I am getting the following error:

Missing required client configuration options: region: (string) A “region” configuration value is required for the “s3” service (e.g., “us-west-2”).

Here is my setup (XXX to hide my creds):

.env file:

filesystems.php file (under the disks):
 'spaces' => [
        'driver' => 's3',
        'key' => env('XXXXX'),
        'secret' => env('XXXXX'),
        'endpoint' => env(''),
        'region' => env('nyc3'),
        'bucket' => env('XXXXXX'),

in the view file:

    function addDocument(Request $req, $projId)
            $validatedData = $req->validate([
                    'uploadFile' => 'required'

            $image = $req->file('uploadFile');

            $file_name = pathinfo($image->getClientOriginalName(), PATHINFO_FILENAME);

            // Get the currently authenticated user...
            $user = \Auth::user();

            // Get the currently authenticated user's ID...
            $uid = \Auth::id();

            $folder = $req->input('folder');

            $folderId = \DB::table('foldernames')->where('name',$folder)->where('common',1)->value('fid');

            if (!$folderId) {

                    $folderId = \DB::table('foldernames')->where('name',$folder)->where('userId',$uid)->value('fid');


            $input['imagename'] = $file_name.'_'.time().'.'.$image->getClientOriginalExtension();

            //$destinationPath = public_path('/images');

            //$image->move($destinationPath, $input['imagename']);

            $destinationPath = $image->store('/', 'spaces');
            Storage::setVisibility($destinationPath, 'public');

            $data = array('fid'=>$folderId,'fileLoc'=>$input['imagename'],'projId'=>$projId);

    return back();


As you can see in the view, I try to store the image on the space and then store the path in the DB which would represent the path to the space.

I cannot get this error to go away; do you see any issues?


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.

Site Moderator
Site Moderator badge
August 7, 2020
Accepted Answer

Hi @Rwpeller

Everything seems correct! Having said that, I do have one suggestion, when configuring :


In your .env file can you set it to be with Uppercase letters? WhatI mean is it should be like


Additionally, the do_spaces block in your filesystem should literally be

do_spaces' => [     
'driver' => 's3',     
'key' => env('DO_SPACES_KEY'),     
'secret' => env('DO_SPACES_SECRET'),     
'endpoint' => env('DO_SPACES_ENDPOINT'),     
'region' => env('DO_SPACES_REGION'),     
'bucket' => env('DO_SPACES_BUCKET'), 

Regards, KFSys

Try DigitalOcean for free

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

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

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

© 2023 DigitalOcean, LLC.