amrsoliman / assets-cdn
Easily load your assets from a CDN when on production.
Installs: 1 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/console: 5.1.x
- illuminate/filesystem: 5.1.x
- illuminate/support: 5.1.x
This package is not auto-updated.
Last update: 2024-12-07 20:44:19 UTC
README
Easily display your Laravel assets through a cdn without having to change a line in your views.
Installation
Add the following require to your composer.json
file:
"require": {
...
"amrsoliman/assets-cdn": "1.*"
},
...
"post-install-cmd": [
...
"php artisan assets-cdn:update"
],
Then run composer update
Add "AmrSoliman\AssetsCdn\AssetsCdnServiceProvider",
to the list of providers in config/app.php
.
Run php artisan vendor:publish
Go to file config/assets-cdn.php
and configure your CDN. We recommend only enabling it in production.
Note on the CDN
Any CDN works provided that the following conditions are met:
- The path on your server is the same as the path on the CDN (i.e. yoursite.com/assets/image.png = the.cdn.net/assets/image.png)
- The CDN passes through query strings, so that we can invalidate previous versions of your file when you install a new commit?