Registry / utility / spatie-url-signer

spatie-url-signer

JSON →
library2.1.3phppackagistunverified

Generate a url with an expiration date and signature to prevent unauthorized access

composer require spatie/url-signer
INSTALL
IMPORT
SIG · SPATIE-URL-SIGNER
S
spatie-url-signer
utilityphpv2.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

UrlSigner
use Spatie\UrlSigner\UrlSigner;

Sign a URL with expiration and validate it

use Spatie\UrlSigner\UrlSigner; $signer = new UrlSigner('your-signature-key'); $url = 'https://example.com/download/file.pdf'; $expirationDate = new DateTime('+1 hour'); $signedUrl = $signer->sign($url, $expirationDate); echo $signedUrl; // Verify later if ($signer->validate($signedUrl)) { echo "URL is valid"; }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.1.3latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources