tozogluburak / laravel-cdn-helper
A Laravel package for CDN integration
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tozogluburak/laravel-cdn-helper
Requires
- php: >=7.3
- illuminate/support: ^8.0|^9.0|^10.0
README
This package provides a simple way to integrate CDN support into your Laravel application.
Installation
-
Add the package to your project via Composer:
composer require tozogluburak/laravel-cdn-helper:^1.8
-
Publish the package's configuration file:
php artisan vendor:publish --provider="tozogluburak\CdnHelper\Discovery\CdnHelperDiscovery" -
After installation, the package will automatically add the CDN helper function to your project.
Configuration
The standard asset() function will be called if no CDN URLs are defined in the ./config/app.php config file.
Define the CDN URLs in the ./config/app.php file:
Add the following configuration to your app.php file:
<?php return [ /* |-------------------------------------------------------------------------- | Application CDN domains |-------------------------------------------------------------------------- | | Specify different domains for your assets. | */ 'cdn' => [ "cdn.example.com" => "", ], ];