PHPackages                             owenconti/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. owenconti/laravel-cloudfront-url-signer

ActiveLibrary

owenconti/laravel-cloudfront-url-signer
=======================================

Laravel 5.6+ wrapper around CloudFront canned signed URLs

2.2.0(6y ago)187MITPHPPHP ^7.1.3

Since Feb 9Pushed 6y agoCompare

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

READMEChangelog (1)Dependencies (4)Versions (14)Used By (0)

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

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

Easy to use Laravel 5.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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% 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 ~60 days

Recently: every ~148 days

Total

11

Last Release

2410d ago

Major Versions

v0.1.5 → v1.0.02018-02-19

v1.0.1 → v2.0.02018-09-24

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

v2.0.0PHP ^7.1.3

### Community

Maintainers

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

---

Top Contributors

[![IlCallo](https://avatars.githubusercontent.com/u/10036108?v=4)](https://github.com/IlCallo "IlCallo (26 commits)")[![owenconti](https://avatars.githubusercontent.com/u/791222?v=4)](https://github.com/owenconti "owenconti (2 commits)")[![alexciarlillo](https://avatars.githubusercontent.com/u/656039?v=4)](https://github.com/alexciarlillo "alexciarlillo (1 commits)")[![nullthoughts](https://avatars.githubusercontent.com/u/11416468?v=4)](https://github.com/nullthoughts "nullthoughts (1 commits)")

---

Tags

cloudfrontdreamonkeylaravel-cloudfront-url-signerprivate content

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[dreamonkey/laravel-cloudfront-url-signer

Laravel 5.6+ wrapper around CloudFront canned signed URLs

54750.7k](/packages/dreamonkey-laravel-cloudfront-url-signer)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)[palpalani/laravel-sqs-queue-json-reader

Custom SQS queue reader for Laravel

26109.8k](/packages/palpalani-laravel-sqs-queue-json-reader)

PHPackages © 2026

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