waiyanhein / lumen-signed-url
Package to generate temporary signd URL for Lumen framework
Installs: 4 724
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.0
- laravel/lumen-framework: >=5.5.x-dev
This package is not auto-updated.
Last update: 2024-11-06 14:08:20 UTC
README
Package to generate signed url for Lumen framework
This package use Laravel file storage system to save the signed URLs, https://laravel.com/docs/8.x/filesystem.
Installation
composer require waiyanhein/lumen-signed-url
Generating temporary Signed URL
$signedUrl = URLSigner::sign("http://testing.com", Carbon::now()->addMinutes(10)->format('Y-m-d H:i:s'));
- Note: the date must be in
Y-m-d H:i:s
format.
Signing URL with parameters
If your URL has parameters you can pass them as the third parameter as array.
$signedUrl = URLSigner::sign("http://testing.com", Carbon::now()->addMinutes(10)->format('Y-m-d H:i:s'), [ 'first_name' = 'Wai', 'last_name' => 'Hein' ]);
Validating the Signed URL
$isValid = URLSigner::validate($signedUrl);