PHPackages                             epiphanyinfotech/laravel-aws-custom-policy-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. [HTTP &amp; Networking](/categories/http)
4. /
5. epiphanyinfotech/laravel-aws-custom-policy-url-signer

ActiveLibrary[HTTP &amp; Networking](/categories/http)

epiphanyinfotech/laravel-aws-custom-policy-url-signer
=====================================================

Get epiphanyinfotech custom policy url to append to cloudfront file with a valid key-pair id and time limit

v1.0.0(4y ago)017MITPHPPHP ^7.4|^8.0

Since Aug 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/epiphanyinfotech/laravel-cloudfront-custom-policy-url-signer)[ Packagist](https://packagist.org/packages/epiphanyinfotech/laravel-aws-custom-policy-url-signer)[ Docs](https://github.com/epiphanyinfotech/laravel-cloudfront-custom-policy-url-signer)[ RSS](/packages/epiphanyinfotech-laravel-aws-custom-policy-url-signer/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Create CloudFront Custom Policy signed URLs in Laravel 6.0+
===========================================================

[](#create-cloudfront-custom-policy-signed-urls-in-laravel-60)

Easy to use Laravel 6+ | 7+ | 8+ wrapper which allows to sign URLs to access Private Content through CloudFront CDN

This package can create custom policy signed URLs for CloudFront which expires after a given time. The default time is set to 86400 seconds or 24 hours. This package does not depends on AWS SDK package, but implements the example from ([https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL\_PHP.html#sample-custom-policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL_PHP.html#sample-custom-policy))

The benefit of this approach is that you can use the same signature for multiple files and hence the processing is much much faster when you are loading multiple signed images/videos or other files on a single page.

This is how you can create signed URL that's valid for 1 day or 24 hour:

Usage
-----

[](#usage)

### Signing URLs

[](#signing-urls)

```
// Add Namespace in Controller
use EpiphanyInfotech\CustomPolicyUrl\CustomPolicyUrl as AWSURL;

/*
 * Instantiate the class and pass the array with values matching
 * the path of the media files in the AWS S3 Bubket
 */

        $key_id = config('aws-custom-policy-url.KEY-ID');

    	$aws_private_key = config('aws-custom-policy-url.AWS-PRIVATE-KEY');

    	$path_arr = array('sample_5mb.mp4','sample_3mb.mp4'); // get the sample files either from your own DB or changing the storage config to s3 bucket and fetching the list of files. Ref.: (https://laravel.com/docs/8.x/filesystem#retrieving-files)

     	$aws_obj = New AWSURL($key_id, $aws_private_key);
    	$get_signed_urls = $aws_obj->getSignedUrls($path_arr);
```

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

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

[](#installation)

The package can be installed via Composer:

```
composer require epiphanyinfotech/laravel-aws-custom-policy-url-signer:^1.0

```

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

[](#configuration)

The configuration file can optionally be published via:

```
php artisan vendor:publish --provider="EpiphanyInfotech\CustomPolicyUrl\CustomPolicyUrlServiceProvider"

```

This is the content of the file:

```
return [
    /*
     * The cloudfront public keys id. Identifies the CloudFront key pair associated to the trusted signer which validates signed URLs.
     * To create a key, refer: https://console.aws.amazon.com/cloudfront/v3/home?region=us-east-2#/publickey
     * Make sure to replace region=us-east-2 with your region
     */
    'KEY-ID' => env("AWS_KEY_ID", NULL),

    /*
     * The private key used to sign all URLs. Make sure it's secured and not accessible to public. Enter absolute path in the .env file
     */
    "AWS-PRIVATE-KEY" => env("AWS_PRIVATE_KEY_FILEPATH", NULL),

    /*
     * The IP address of the client making the GET request. For further info, visit: (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) and search for - "IpAddress (Optional)"
     */
    "CLIENT_IP" => env("AWS_CLIENT_IP", NULL),,

    /*
     * Your CloudFront domain URL. To check your cloudfront domain, visit: (https://console.aws.amazon.com/cloudfront/v3/home?region=us-east-2#/distributions)
	 * Make sure to replace region=us-east-2 with your region.
	 * The "Domain Name" is your URL. If you have configured cloudfront to use the custom domain, then enter that.
     */
    "AWS_URL" => env("AWS_URL", NULL),

];
```

Security
--------

[](#security)

If you discover any security related issues, please email  or use the issue tracker.

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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

Unknown

Total

1

Last Release

1744d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb556124b582b18144a8f97d45c7da49fe83c718028f73db5f26e493e1b093ca?d=identicon)[brajinderism](/maintainers/brajinderism)

---

Top Contributors

[![brajindersingh](https://avatars.githubusercontent.com/u/12485069?v=4)](https://github.com/brajindersingh "brajindersingh (5 commits)")[![brajinderism](https://avatars.githubusercontent.com/u/76520260?v=4)](https://github.com/brajinderism "brajinderism (3 commits)")

---

Tags

custom-policy-signed-urlepiphanyinfotech

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/epiphanyinfotech-laravel-aws-custom-policy-url-signer/health.svg)

```
[![Health](https://phpackages.com/badges/epiphanyinfotech-laravel-aws-custom-policy-url-signer/health.svg)](https://phpackages.com/packages/epiphanyinfotech-laravel-aws-custom-policy-url-signer)
```

###  Alternatives

[danharrin/livewire-rate-limiting

Apply rate limiters to Laravel Livewire actions.

40423.1M27](/packages/danharrin-livewire-rate-limiting)[mateusjunges/laravel-kafka

A kafka driver for laravel

7163.1M17](/packages/mateusjunges-laravel-kafka)[illuminate/http

The Illuminate Http package.

11936.0M5.1k](/packages/illuminate-http)[ricorocks-digital-agency/soap

A SOAP client that provides a clean interface for handling requests and responses.

4281.8M5](/packages/ricorocks-digital-agency-soap)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)

PHPackages © 2026

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