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

dev_nope's avatar

S3 disk put() fails silently. Any ideas why?

Hey everyone, did any of run into the issue where Storage::disk('s3')->put() would fail silently? It basically returns false. Here's some info:

  • I'm using Laravel Sail
  • I did install league/flysystem-aws-s3-v3
  • I did create an AWS bucket + IAM user and added credentials to the .env file
  • I did try to use \Aws\S3\S3Client directly to upload a local file and that worked just fine:
$s3Client = new \Aws\S3\S3Client([
    'region' => env('AWS_DEFAULT_REGION'),
    'version' => 'latest',
    'debug' => true,
    'credentials' => [
        'key'    => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
    ]
]);

$result = $s3Client->putObject([
    'Bucket'     => env('AWS_BUCKET'),
    'Key'        => 'test.jpg',
    'SourceFile' => storage_path('app/test.jpg'),
]);

dd($result->get('ObjectURL')); // outputs the uploaded file URL
  • then I ran Storage::disk('s3')->exists('test.jpg') and that returns true, which makes me think that I can successfully connect to S3.
  • what am I missing here? This is driving me crazy. It might be some little things I'm missing, idk... Thanks in advance!
0 likes
2 replies
LoreSco's avatar

Hi @dev_nope , i'm facing the same issue except I'm using Bref. Did you end up solving it?

Please or to participate in this conversation.