PHPackages                             metrique/laravel-cdnify - 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. metrique/laravel-cdnify

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

metrique/laravel-cdnify
=======================

Add a CDN to any path when a specified environment is active.

1.2.12(4y ago)83.9kMITPHP

Since Jun 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/metrique/laravel-cdnify)[ Packagist](https://packagist.org/packages/metrique/laravel-cdnify)[ RSS](/packages/metrique-laravel-cdnify/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (1)Versions (25)Used By (0)

laravel-cdnify
==============

[](#laravel-cdnify)

![GitHub release](https://camo.githubusercontent.com/1c851419ceb51be423c79f5139999831bc3a9967e489b035eadfc4a4ab417f43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d657472697175652f6c61726176656c2d63646e6966792e7376673f6d61784167653d32353932303030)

Features
--------

[](#features)

- Add a CDN to any path when a specified environment is active in Laravel 5.
- Easily publish laravel-mix or laravel-elixir versioned assets to a file system of your choice.

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

[](#installation)

### Set up.

[](#set-up)

1. `composer require metrique/laravel-cdnify`
2. Optionally add `Metrique\CDNify\CDNifyServiceProvider::class` to the list of *Autoloaded Service Providers* in `config/app.php`.
3. Optionally add `'CDNify'=>Metrique\CDNify\CDNifyFacade::class` to the list of *Class Aliases* in `config/app.php`.

CDNify supports Laravel Package Discovery and so steps 2 and 3 are optional.

### Config.

[](#config)

Config defaults can be configured by editing `config/cdnify.php` in your main application directory.

You can publish the `config/cdnify.php` config file to your application config directory by running `php artisan vendor:publish --tag="cdnify-config"`

Usage
-----

[](#usage)

### Examples.

[](#examples)

#### Get Helper

[](#get-helper)

A resource exists in your mix-manifest.json, which has been created by Laravel Mix. ``

#### Get the CDN as a string.

[](#get-the-cdn-as-a-string)

`$cdnify->cdn();`

#### Set a local path and get the full CDN path.

[](#set-a-local-path-and-get-the-full-cdn-path)

`$cdnify->path('/some/static/resource.jpg')->toString();`

### CDNify

[](#cdnify)

$cdnify is automatically registered for use in all Laravel views.

`$cdnify->defaults();` If *environments*, *mix* or *roundRobin* settings are changed, this will discard the changes in favour of the config settings.

`$cdnify->cdn();` Returns a CDN path from the config, if roundRobin is set to true then it will iterate through the list of CDN's on each call.

`$cdnify->path($path);` Sets the path to be CDNified.

`$cdnify->toString();` Returns the CDN and path as a string.

`$cdnify->get($path, $params = []);` Helper utility combining the path and toString methods. You may pass an array of params (mix, environments, roundRobin) to override the settings once.

`$cdnify->environments($environments);` Set the environments where the path should be CDNified.

`$cdnify->mix($bool);` Sets whether mix should be used, if available.

`$cdnify->roundRobin($bool);` Enables round robin iteration on the cdn list.

### CDNify command

[](#cdnify-command)

`php artisan metrique:cdnify`This command will run `npm run production` or `gulp --production` and then deploy any assets listed in mix-manifest.json to s3 (or other disk), via the Laravel Filesystem.

### Options

[](#options)

`--build-source[=BUILD-SOURCE]` Sets the path to the source files that are to be uploaded. \[default: "/build"\]

`--build-dest[=BUILD-DEST]` Sets the path where files are to be uploaded. \[default: "/build"\].

`--disk[=DISK]` Set disk/upload method. \[default: "s3"\]

`--force` Toggle force upload of files.

`--skip-build` Skips the running `npm run production` or `gulp --production` build process.

`--manifest[=MANIFEST]` Set manifest location. \[default: "/build/mix-manifest.json"\]

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~80 days

Recently: every ~221 days

Total

24

Last Release

1804d ago

Major Versions

0.1 → 1.1.02017-03-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ce21c219de2c3d8cdc50da260a50446b8d3ff1a59d0fa401f14c5cdcce2f626?d=identicon)[ShinobiCorp](/maintainers/ShinobiCorp)

---

Top Contributors

[![DanielHudson](https://avatars.githubusercontent.com/u/471505?v=4)](https://github.com/DanielHudson "DanielHudson (76 commits)")

---

Tags

buildcdnelixirlaravellaravel-cdnifymix

### Embed Badge

![Health badge](/badges/metrique-laravel-cdnify/health.svg)

```
[![Health](https://phpackages.com/badges/metrique-laravel-cdnify/health.svg)](https://phpackages.com/packages/metrique-laravel-cdnify)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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