PHPackages                             unisharp/s3-presigned - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. unisharp/s3-presigned

ActiveLibrary[File &amp; Storage](/categories/file-storage)

unisharp/s3-presigned
=====================

An AWS S3 package for pre-signed upload purpose in Laravel and PHP.

v0.2(8y ago)141.8k6[1 PRs](https://github.com/UniSharp/s3-presigned/pulls)MITPHPPHP ^5.6.4 || ^7.0CI failing

Since Oct 27Pushed 6y ago10 watchersCompare

[ Source](https://github.com/UniSharp/s3-presigned)[ Packagist](https://packagist.org/packages/unisharp/s3-presigned)[ RSS](/packages/unisharp-s3-presigned/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

AWS S3 Presigned SDK
====================

[](#aws-s3-presigned-sdk)

[![php-badge](https://camo.githubusercontent.com/4cbdbfeca62402b9ca3d48503f2bf66fc9809569bcd6de47196d39fecff71e72/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e737667)](https://camo.githubusercontent.com/4cbdbfeca62402b9ca3d48503f2bf66fc9809569bcd6de47196d39fecff71e72/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e737667)[![packagist-badge](https://camo.githubusercontent.com/54b0c6aa93720b4c78ce025f49b2a27efc46129a6c7b7616949c17d7ca3c9f96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756e6973686172702f73332d7072657369676e65642e737667)](https://packagist.org/packages/unisharp/s3-presigned)

Approach
--------

[](#approach)

Traditionally to upload a file from users to a private S3 bucket needs two internet connections. One is from client to your own server, and the other is from your server to S3 bucket. Using pre-signed upload can solve this problem. Your server issues pre-signed upload url for client to upload in advance, and the client can upload his file to S3 bucket directly within an authorized time period. This package wraps S3 pre-signed api for PHP and Laravel.

Installation
------------

[](#installation)

```
composer require unisharp/s3-presigned

```

Laravel 5
---------

[](#laravel-5)

### Setup

[](#setup)

Add ServiceProvider and Facade in `app/config/app.php`.

```
Unisharp\S3\Presigned\S3PresignedServiceProvider::class,

```

```
'S3Presigned' => Unisharp\S3\Presigned\Facades\S3Presigned::class,

```

> It supports package discovery for Laravel 5.5.

### Configuration

[](#configuration)

Add settings to **.env** file.

```
// required
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=

// optional
AWS_REGION=ap-northeast-1
AWS_VERSION=latest
AWS_S3_PREFIX=

```

APIs
----

[](#apis)

```
/*
 * @return string
 */
public function getSimpleUploadUrl($key, $minutes = 10, array $options = [], $guzzle = false)
```

- $key: your s3 file key, a prefix will be prepended automatically.
- $minutes: expire time for the pre-signed url.
- $options: see [AWS docs](http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#putobject) to find more.
- $guzzle: set true if you want to get a guzzle instance instead of string.

```
/*
 * @return array('endpoint', 'inputs')
 */
public function getUploadForm($minutes = 10, array $policies = [], array $defaults = [])
```

- $minutes: expire time for the pre-signed url.
- $policies: see [AWS docs](http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html) to find more.
- $defaults: default key-values you want to add to form inputs.

> for more detail, please see: [AWS docs](https://aws.amazon.com/tw/articles/browser-uploads-to-s3-using-html-post-forms)

```
/*
 * @return array
 */
public function listObjects($directory = '', $recursive = false)
```

```
/*
 * @return boolean
 */
public function deleteObject($key)
```

```
/*
 * @return string
 */
public function getBaseUri()
```

```
/*
 * @return this
 */
public function setPrefix($prefix)
```

```
/*
 * @return string
 */
public function getPrefix()
```

```
/*
 * @return this
 */
public function setBucket($bucket)
```

```
/*
 * @return string
 */
public function getBucket()
```

```
/*
 * @return Aws\S3\S3Client
 */
public function getClient()
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

3113d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8b4d1f7bf254a37c8fa948495bb20006283adcad2de40d50ac14c0d379ab920?d=identicon)[albertcht](/maintainers/albertcht)

---

Top Contributors

[![albertcht](https://avatars.githubusercontent.com/u/9117929?v=4)](https://github.com/albertcht "albertcht (14 commits)")[![mhamlet](https://avatars.githubusercontent.com/u/1281731?v=4)](https://github.com/mhamlet "mhamlet (1 commits)")[![streamtw](https://avatars.githubusercontent.com/u/7333171?v=4)](https://github.com/streamtw "streamtw (1 commits)")

---

Tags

phplaravels3awsuploadpre-signed

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unisharp-s3-presigned/health.svg)

```
[![Health](https://phpackages.com/badges/unisharp-s3-presigned/health.svg)](https://phpackages.com/packages/unisharp-s3-presigned)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M74](/packages/aws-aws-sdk-php-laravel)[vinelab/cdn

Content Delivery Network (CDN) Package for Laravel

217240.8k1](/packages/vinelab-cdn)[publiux/laravelcdn

Content Delivery Network (CDN) Package for Laravel

155230.4k](/packages/publiux-laravelcdn)[juhasev/laravelcdn

Content Delivery Network (CDN) Package for Laravel

1820.4k](/packages/juhasev-laravelcdn)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
