2017 © Pedro Peláez
 

library signed-s3-filesystem

Extension of the Laravel S3 filesystem to return signed URLs

image

jdavidbakr/signed-s3-filesystem

Extension of the Laravel S3 filesystem to return signed URLs

  • Friday, November 10, 2017
  • by jdavidbakr
  • Repository
  • 1 Watchers
  • 6 Stars
  • 519 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 18 % Grown

The README.md

Please use Storage::temporaryUrl() instead of this package

As of Laravel 5.5, the Storage facade contains this functionality internally. Therefore, it is recommended to sign your URLs according to the way Laravel intends., (*1)

signed-s3-filesystem

Latest Version on Packagist ![Software License][ico-license] ![Total Downloads][ico-downloads], (*2)

This package extends Laravel's S3 filesystem driver to return signed URLs via the Storage::url() command., (*3)

Install

Via Composer, (*4)

``` bash $ composer require jdavidbakr/signed-s3-filesystem, (*5)


Once installed, add the following to your providers array in cofig/app.php:

jdavidbakr\SignedS3Filesystem\SignedS3FilesystemServiceProvider::class,, (*6)


This package makes use of the AWS facade, so be sure you have the following set in your providers array:

Aws\Laravel\AwsServiceProvider::class,, (*7)


as well as in your alias array:

'AWS' => Aws\Laravel\AwsFacade::class,, (*8)


You will also need to add the driver information to your config/filesystems.php file. This driver uses the same info as the S3 driver, with an additional parameter for the length of time until the signed URL will expire. If you do not specify an expiration time, URLs will default to expire 2 hours after being generated.

's3-signed' => [ 'driver' => 's3-signed', 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', 'options' => [ 'expiration'=>'time-to-expire-urls-in-seconds', ], ],, (*9)


Because the expiration option is optional, and everything else acts the same as the standard S3 driver, you can alternatively just change the driver value of the existing s3 section to 's3-signed'. ## Usage Use this driver in the same manner as you would any other Laravel filesystem driver. The Storage::url() command will return a signed URL. ``` php $signed_url = Storage::disk('s3-signed')->url('path-to-file');

Testing

bash $ composer test, (*10)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*11)

Security

If you discover any security related issues, please email me@jdavidbaker.com instead of using the issue tracker., (*12)

Credits

License

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

The Versions

10/11 2017
20/10 2017
21/11 2016

1.0.0

1.0.0.0 https://github.com/jdavidbakr/SignedS3Filesystem

Extension of the Laravel S3 filesystem to return signed URLs

  Sources   Download

MIT

The Requires

 

The Development Requires

jdavidbakr signeds3filesystem