Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
config
migrations
src/Smrt/Framework/CdnUrl
tests
README.md

README.md

CDN URL

This package manages our CDN properties and lets you call a file located from the CDN.

Requirements

  • PHP >= 5.4

CMS Setup

Add the Smrt\Framework\CdnUrl\AdminCdnUrlServiceProvider provider to the provider array in app/config/app.php

'providers' => [
  ...
  'Smrt\Framework\CdnUrl\AdminCdnUrlServiceProvider',
],

Add the facade to your aliases array

'aliases' => [
  ...
  'CDN' => 'Smrt\Framework\CdnUrl\Facades\Cdn',
],

Platform Setup

Add the Smrt\Framework\CdnUrl\CdnUrlServiceProvider provider to the provider array in app/config/app.php

'providers' => [
  ...
  'Smrt\Framework\CdnUrl\AdminCdnUrlServiceProvider',
],

Add the facade to your aliases array

'aliases' => [
  ...
  'CDN' => 'Smrt\Framework\CdnUrl\Facades\Cdn',
],

Basic Usage

Assuming the facade is setup for CDN.

CDN::url();

Returns a string to the CDN file with hash protection.

Param Required Default Type Description
$type true null string The content type setting.
$file true null string The path to the file.
$site false null int The site ID the content belongs to.
CDN::url('videos', '/path/to/file.mp4', 7);

CDN::unhashed();

Returns a string to the CDN file with without hash protection.

Param Required Default Type Description
$type true null string The content type setting.
$file true null string The path to the file.
$site false null int The site ID the content belongs to.
CDN::unhashed('videos', '/path/to/file.mp4', 7);

Console Commands

You can flush the CDN hostnames cache with the following console command.

php artisan cdn-url:flushAll
You can’t perform that action at this time.