waiyanhein/lumen-signed-url

There is no license information available for the latest version (1.0.0) of this package.

Package to generate temporary signd URL for Lumen framework

1.0.0 2021-01-15 15:13 UTC

This package is not auto-updated.

Last update: 2024-04-24 11:48:54 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);