2017 © Pedro Peláez
 

library photon-image-cdn

CDN from Photon (Automattic) to Laravel

image

alan-mosko/photon-image-cdn

CDN from Photon (Automattic) to Laravel

  • Thursday, June 14, 2018
  • by moskoweb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Photon Image CDN 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)

Install

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

Usage

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') !!}

Config

return [
    'quality' => 70, // Quality of image requested for Photon
    'max_width' => null,
    'max_height' => null,
    'server' => '3' // 0-3 or random
];

The Versions

14/06 2018

dev-master

9999999-dev

CDN from Photon (Automattic) to Laravel

  Sources   Download

MIT

The Requires