dev-master
9999999-devCDN from Photon (Automattic) to Laravel
MIT
The Requires
- php >=7.0
- illuminate/support 5.*
CDN from Photon (Automattic) to Laravel
CDN from Photon (Automattic) to Laravel., (*1)
A practical and quick way to use Automattic CDN, created for WordPress, next to your Laravel project., (*2)
With Photon's CDN, you have a web-optimized image, removing all unnecessary information for the web, in addition to high speed and low latency., (*3)
composer require alan-mosko/photon-image-cdn
Add the service provider to the providers array and alias to the aliases array in config/app.php., (*4)
'providers' => [ AlanMosko\PhotonImageCdn\PhotonImageCdnServiceProvider::class, ],
'aliases' => [ 'ImgCdn' => AlanMosko\PhotonImageCdn\Helpers\PhotonImageCdnHelper::class,, ],
Publish the configuration:, (*5)
php artisan vendor:publish
So you can use the images through the Photon CDN is very simple., (*6)
You have two options for using the images, one being just to get the new URL of your image in Photon., (*7)
And the other way, is by creating the tag directly with the Photon URL., (*8)
// Image URL <img src="{{ ImgCdn::url('https://picsum.photos/1000/500/', '500px', '200px') }}"> // Image Tag {!! ImgCdn::tag('https://picsum.photos/1000/500/', 'Imagem de Teste') !!}
return [ 'quality' => 70, // Quality of image requested for Photon 'max_width' => null, 'max_height' => null, 'server' => '3' // 0-3 or random ];
CDN from Photon (Automattic) to Laravel
MIT