async-aws/s3
AsyncAws S3 Client is a lightweight PHP API client for Amazon S3. Install via Composer and use a modern, non-blocking-friendly SDK alternative with typed requests/responses. Full docs and contribution guide available at async-aws.com.
Install the package via Composer:
composer require async-aws/s3
Initialize the client using default credentials (e.g., environment variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optionally AWS_REGION):
use AsyncAws\S3\S3Client;
$s3 = new S3Client();
The fastest first use case is uploading a small file:
$s3->putObject([
'Bucket' => 'my-bucket',
'Key' => 'path/to/object.txt',
'Body' => 'Hello world',
]);
Check documentation at https://async-aws.com/clients/s3.html for core operations and request builders.
GuzzleHttp\Psr7\StreamWrapper or PHP stream resources for memory-efficient handling:
$s3->putObject([
'Bucket' => 'my-bucket',
'Key' => 'large-file.dat',
'Body' => fopen('/tmp/large-file.dat', 'r'),
]);
$presigner = new \AsyncAws\S3\Presigner($s3);
$url = $presigner->getPresignedUrl('GetObject', [
'Bucket' => 'my-bucket',
'Key' => 'private-file.txt',
], '+10 minutes');
createMultipartUpload() + uploadPart() + completeMultipartUpload() for reliability with large objects.listObjectsV2() with pagination or deleteObjects() for bulk deletions.ap-southeast-7, mx-central-1, etc.)—to avoid routing overhead:
$s3 = new S3Client(['region' => 'ap-southeast-7']);
getContentLength() and similar fields now use int. Ensure your validation/error handling reflects this—especially if migrating from v1.x-amz-meta-) appear on GetObject/HeadObject metadata keys. Normalize keys if accessing raw metadata.my.bucket), explicitly enable s3PathStyleEndpoint: true in client config.StorageClass::GLACIER) over strings—unknown values fall back to UNKNOWN_TO_SDK to avoid silent failures.null is now accepted for optional fields (e.g., 'Tagging' => null), useful for resetting configurations.eu-isoe-west-1, us-isof-*, mx-central-1) require up-to-date SDK versions—check changelogs when testing compliance/fips endpoints.How can I help you explore Laravel packages today?