svikramjeet / s3-presigned
PHP wrapper of S3 api for pre-signed url
1.0.3
2023-03-17 06:27 UTC
Requires
- php: ^8.1
- aws/aws-sdk-php: ^3.261
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
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.