Available Events
MultipartUploadCreated
Dispatched when a new multipart upload is created on S3. Namespace:MrEduar\S3M\Events\MultipartUploadCreated
When Dispatched: After successfully creating a multipart upload session via the POST /s3m/create-multipart-upload endpoint (see S3MultipartController.php:50).
Properties
The unique identifier generated for this upload. This UUID is used as the filename in the S3 key.
The S3 bucket where the upload is being stored.
The full S3 object key (path) where the file will be stored. Format:
{folder}/{uuid}The AWS multipart upload ID returned by S3. Used to track and complete the upload.
Listening to the Event
Create a listener in your Laravel application:The event uses Laravel’s
Dispatchable and SerializesModels traits, making it compatible with queued listeners.MultipartUploadCompleted
Dispatched when a multipart upload is successfully completed on S3. Namespace:MrEduar\S3M\Events\MultipartUploadCompleted
When Dispatched: After successfully completing a multipart upload via the POST /s3m/complete-multipart-upload endpoint (see S3MultipartController.php:107).
Properties
The S3 bucket where the file was uploaded.
The full S3 object key (path) where the file is stored.
The AWS multipart upload ID that was completed.
The full URL (Location) of the uploaded file on S3.
Listening to the Event
Create a listener in your Laravel application:Both events support queued listeners via Laravel’s
ShouldQueue interface, allowing you to offload heavy processing.Common Use Cases
Database Tracking
Database Tracking
Listen to
MultipartUploadCreated to store upload metadata in your database with status in_progress, then update the record to completed when MultipartUploadCompleted is dispatched.User Notifications
User Notifications
Send real-time notifications to users when their uploads complete by listening to
MultipartUploadCompleted.File Processing
File Processing
Trigger post-upload processing (virus scanning, thumbnail generation, etc.) by listening to
MultipartUploadCompleted.Analytics & Logging
Analytics & Logging
Track upload metrics, monitor failures, and generate reports by listening to both events.