iritesh377 / laravel-local-temporary-url
Quickly add support for temporary url for local filesystem drivers
Requires
- php: ^8.2
- spatie/laravel-package-tools: ^1.16.4
Requires (Dev)
- laravel/pint: ^1.14.0
- nunomaduro/collision: ^8.1.1
- orchestra/testbench: ^9.0.1
- pestphp/pest: ^2.34.4
- pestphp/pest-plugin-arch: ^2.7.0
- pestphp/pest-plugin-laravel: ^2.3.0
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan-deprecation-rules: ^1.1.4
- phpstan/phpstan-phpunit: ^1.3.16
README
Installation
You can install the package via composer:
composer require iritesh377/laravel-local-temporary-url
You can publish the config file with:
php artisan vendor:publish --tag="local-temporary-url-config"
This is the contents of the published config file:
return [ 'disk' => ['local'], 'middleware' => ['web', 'signed'] ];
Usage
Configuration
This package requires no configuration; simply install it and it's ready to use. However, if you wish to utilize a different local disk or add additional disks, configuration options are available. Multiple local disks can be configured using the disk
key.
By default, the package applies web
and signed
middleware on routes. Nevertheless, you have the flexibility to configure middleware(s) by using the middleware
key.
Generate Temporary URL
Temporary URLs can be generated using the same syntax as for the S3 disk.
Storage::disk('local')->temporaryUrl('file.txt', now()->addMinutes(5));
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.