To upload files to Amazon S3 in Laravel 13, install league/flysystem-aws-s3-v3 , add your AWS credentials and bucket to .env , and store the uploaded file with $request->file('document')->store('documents', 's3') . Save the returned path in the database, and use Storage::disk('s3')->temporaryUrl() to give users time-limited access to private files.
Moving uploads off the web server is one of the first things I do when an app needs more than one server or a container-based deployment. Local disks do not survive redeploys and are not shared between instances; S3 solves both problems with almost no code change because Laravel's filesystem API stays the same.
Prerequisites
Laravel 13.x on PHP 8.3 or newer.
An AWS account, an S3 bucket, and an IAM user or role with permission to read and write that bucket.
Block Public Access left on for the bucket, unless you deliberately serve public files.
Step 1: Install the S3 driver
composer require league/flysystem-aws-s3-v3 "^3.0" --with-all-dependencies
Enter…