svikramjeet/s3-presigned

PHP wrapper of S3 api for pre-signed url

1.0.3 2023-03-17 06:27 UTC

README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Create presigned url for S3 object

  • for uploading an object to S3 via Put
  • for get presigned URL for already uploaded object to S3

Installation

You can install the package via composer:

composer require svikramjeet/s3-presigned

You can publish the config file with:

php artisan vendor:publish --tag="s3-presigned-config"

Usage

Get url for private s3 object

$s3Presigned = new Svikramjeet\S3Presigned\S3Presigned();
echo $s3Presigned->createPresignedForGetRequest($request)['presigned_url'];

Get url to upload object via presigned POST request

$s3Presigned = new Svikramjeet\S3Presigned\S3Presigned();
echo $s3Presigned->createPresignedForPostRequest($request)['presigned_url'];

Get url to upload object via presigned PUT request

$s3Presigned = new Svikramjeet\S3Presigned\S3Presigned();
echo $s3Presigned->createPresignedForPutRequest($request)['presigned_url'];

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.