Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lara30453's avatar

AWS S3 and filesystem

Is there any good tutorials on how to implement s3 on a laravel app. The docs lack information so I'm finding it hard to get it working. Could anyone share a step by step guide?

Edit:

  • im trying to creat a folder using this code:
Storage::disk('s3')->makeDirectory('users/' . $request->input('username'));

and imports

use Storage;
use League\Flysystem\Filesystem;
S3Exception in WrappedHttpHandler.php line 152:
Error executing "PutObject" on "https://s3.Oregon.amazonaws.com/s3.meeu.com/users/Joshedijjdied/"; AWS HTTP error: cURL error 6: Could not resolve host: s3.Oregon.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
0 likes
7 replies
lara30453's avatar

I have used composer to install this: league/flysystem-aws-s3-v3 ~1.0

Then I used these:

use Storage;
use League\Flysystem\Filesystem;

with this code to create a new directory

Storage::disk('s3')->makeDirectory('users/' . $request->input('username'));

However its returning an error as shown above ?

noeldiaz's avatar
Level 23

Looks like you have the wrong entry for your region. You are trying to use Oregon? I believe the right address for that one is:

s3-us-west-2.amazonaws.com

You have:

s3.oregon.amazonaws.com

Which does not work.

lara30453's avatar

So what packages should I use? Just the one that is specified in the laravel docs ?

lara30453's avatar

I done it guys! I was just over complicating it as I normally do haha. Thanks for your help guys!

Please or to participate in this conversation.