Overview
TheS3M class provides the core functionality for managing multipart uploads to AWS S3. It handles S3 client configuration, bucket management, and multipart upload completion.
Namespace: MrEduar\S3M\S3M
Methods
getBucket()
Get the configured S3 bucket name from the configuration.The configured S3 bucket name from
config('s3m.s3.bucket')Example
ensureConfigureVariablesAreAvailable()
Validate that all required S3 configuration variables are available before performing operations.Optional configuration overrides
Custom bucket name (if not provided, checks config)
Validated Configuration Keys
The method validates the following configuration keys fromconfig('s3m.s3'):
bucket(unless provided in options)regionkey(AWS access key)secret(AWS secret key)
Exceptions
Thrown when required configuration variables are missing. The exception message includes the names of missing variables.
Example
storageClient()
Create and return an AWS S3 client instance configured with the settings from your S3M configuration.Configured AWS S3 client instance
Configuration
The client is configured using values fromconfig('s3m.s3') with the following parameters:
region- AWS regionversion- API version (always ‘latest’)signature_version- Signature version (always ‘v4’)use_path_style_endpoint- Path style endpoint settingcredentials- AWS credentials (key, secret, token)url- Custom S3 endpoint URL (optional)endpoint- Custom endpoint (optional)
Example
completeMultipartUpload()
Complete a multipart upload operation by assembling all uploaded parts into a single S3 object.Upload completion options
S3 bucket name (defaults to configured bucket)
The S3 object key (file path)
The multipart upload ID from
createMultipartUploadExample
Exceptions
Thrown if required S3 configuration variables are missing
Facade Usage
All methods are available through theS3M facade: