PHPackages                             dreamonkey/laravel-cloudfront-url-signer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dreamonkey/laravel-cloudfront-url-signer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dreamonkey/laravel-cloudfront-url-signer
========================================

Laravel 5.6+ wrapper around CloudFront canned signed URLs

v3.4.0(3y ago)54750.7k↓16.3%37[1 issues](https://github.com/dreamonkey/laravel-cloudfront-url-signer/issues)[2 PRs](https://github.com/dreamonkey/laravel-cloudfront-url-signer/pulls)MITPHPPHP ^7.3.0|^8.0

Since Feb 9Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dreamonkey/laravel-cloudfront-url-signer)[ Packagist](https://packagist.org/packages/dreamonkey/laravel-cloudfront-url-signer)[ Docs](https://github.com/dreamonkey/laravel-cloudfront-url-signer)[ RSS](/packages/dreamonkey-laravel-cloudfront-url-signer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (19)Used By (0)

!!!! THIS PACKAGE IS UNMAINTAINED !!!! Feel free to fork and start maintaining a copy yourself, we can link here popular forks

Create CloudFront signed URLs in Laravel 6+
===========================================

[](#create-cloudfront-signed-urls-in-laravel-6)

Easy to use Laravel 6+ wrapper around the official AWS PHP SDK which allows to sign URLs to access Private Content through CloudFront CDN

Inspired by [laravel-url-signer](https://github.com/spatie/laravel-url-signer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/820b22d601644792adebff630b20d9723688f7db6df01c86fe47a5e0c4007448/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647265616d6f6e6b65792f6c61726176656c2d636c6f756466726f6e742d75726c2d7369676e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dreamonkey/laravel-cloudfront-url-signer)[![Total Downloads](https://camo.githubusercontent.com/1b54ae85de9f3ba8ebf850f8a5d406d0ec258f023f15bd637547ab0b097b0416/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647265616d6f6e6b65792f6c61726176656c2d636c6f756466726f6e742d75726c2d7369676e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dreamonkey/laravel-cloudfront-url-signer)

This package can create canned policies signed URLs for CloudFront which expires after a given time. This is done by wrapping the AWS SDK method adding a Laravel-style configuration and accessibility.

This is how you can create signed URL that's valid for 30 days:

```
// With Facade
CloudFrontUrlSigner::sign('https://myapp.com/resource', 30);

// With helper
sign('https://myapp.com/resource', 30);
```

The output is compliant with [CloudFront specifications](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-canned-policy.html)

Installation
------------

[](#installation)

The package can be installed via Composer:

```
composer require dreamonkey/laravel-cloudfront-url-signer

```

Configuration
-------------

[](#configuration)

The configuration file can optionally be published via:

```
php artisan vendor:publish --provider="Dreamonkey\CloudFrontUrlSigner\CloudFrontUrlSignerServiceProvider"

```

This is the content of the file:

```
return [
    /*
     * The default expiration time of a URL in days.
     */
    'default_expiration_time_in_days' => 1,

    /*
     * The private key used to sign all URLs.
     */
    'private_key_path' => storage_path(env('CLOUDFRONT_PRIVATE_KEY_PATH', 'trusted-signer.pem')),

    /*
     * Identifies the CloudFront key pair associated
     * to the trusted signer which validates signed URLs.
     */
    'key_pair_id' => env('CLOUDFRONT_KEY_PAIR_ID', ''),

    /*
     * CloudFront API version, by default it uses the latest available.
     */
    'version' => env('CLOUDFRONT_API_VERSION', 'latest'),

];
```

Usage
-----

[](#usage)

### Signing URLs

[](#signing-urls)

URL's can be signed with the `sign` method:

```
CloudFrontUrlSigner::sign('https://myapp.com/resource');
```

By default the lifetime of an URL is one day. This value can be change in the config-file. If you want a custom life time, you can specify the number of days the URL should be valid:

```
// The generated URL will be valid for 5 days.
CloudFrontUrlSigner::sign('https://myapp.com/resource', 5);
```

For fine grained control, you may also pass a `DateTime` instance as the second parameter. The url will be valid up to that moment. This example uses Carbon for convenience:

```
// This URL will be valid up until 2 hours from the moment it was generated.
CloudFrontUrlSigner::sign('https://myapp.com/resource', Carbon\Carbon::now()->addHours(2) );
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Paolo Caleffi](https://github.com/IlCallo)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 78% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Recently: every ~281 days

Total

17

Last Release

1141d ago

Major Versions

v0.1.5 → v1.0.02018-02-19

v1.0.1 → v2.0.02018-09-24

v2.3.0 → v3.0.02020-03-05

PHP version history (4 changes)v0.1.0PHP ^7.1

v2.0.0PHP ^7.1.3

v3.1.0PHP ^7.3.0

v3.2PHP ^7.3.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f5033bac39667fc110154e11453950d104c830f42aa2a6a15a551cfffe06727?d=identicon)[Dreamonkey](/maintainers/Dreamonkey)

---

Top Contributors

[![IlCallo](https://avatars.githubusercontent.com/u/10036108?v=4)](https://github.com/IlCallo "IlCallo (32 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![dcodegroup](https://avatars.githubusercontent.com/u/11023162?v=4)](https://github.com/dcodegroup "dcodegroup (1 commits)")[![mikebarlow](https://avatars.githubusercontent.com/u/293049?v=4)](https://github.com/mikebarlow "mikebarlow (1 commits)")[![musicin3d](https://avatars.githubusercontent.com/u/1058893?v=4)](https://github.com/musicin3d "musicin3d (1 commits)")[![nullthoughts](https://avatars.githubusercontent.com/u/11416468?v=4)](https://github.com/nullthoughts "nullthoughts (1 commits)")[![aleahy](https://avatars.githubusercontent.com/u/2275333?v=4)](https://github.com/aleahy "aleahy (1 commits)")[![owenconti](https://avatars.githubusercontent.com/u/791222?v=4)](https://github.com/owenconti "owenconti (1 commits)")[![alexciarlillo](https://avatars.githubusercontent.com/u/656039?v=4)](https://github.com/alexciarlillo "alexciarlillo (1 commits)")

---

Tags

cloudfrontdreamonkeylaravel-cloudfront-url-signerprivate content

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dreamonkey-laravel-cloudfront-url-signer/health.svg)

```
[![Health](https://phpackages.com/badges/dreamonkey-laravel-cloudfront-url-signer/health.svg)](https://phpackages.com/packages/dreamonkey-laravel-cloudfront-url-signer)
```

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[napp/xray-laravel

AWS X-Ray for Laravel applications.

61407.3k](/packages/napp-xray-laravel)[jdavidbakr/cloudfront-proxies

Sets proxy settings for Cloudfront in a Laravel project

23274.4k](/packages/jdavidbakr-cloudfront-proxies)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
