PHP code example of astrotomic / laravel-imgix

1. Go to this page and download the library: Download astrotomic/laravel-imgix library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

astrotomic / laravel-imgix example snippets


return [
    'default' => 'default',

    'sources' => [
        'default' => [
            'domain' => 'example.imgix.net', // domain only - without http(s)
            // 'useHttps' => true, // default is true - you shouldn't change this
            // 'signKey' => null, // your signing key for this domain
            // '

use Astrotomic\Imgix\Facades\Imgix;

Imgix::createURL('my/cool/image.jpg');
// https://example.imgix.net/my/cool/image.jpg?ixlib=php-3.3.0

Imgix::source('astrotomic')->createURL('logo.png');
// https://img.astrotomic.info/logo.png?s=200c1c2065023265285dcbc4eff99955

imgix()->createURL('my/cool/image.jpg');
// https://example.imgix.net/my/cool/image.jpg?ixlib=php-3.3.0

imgix('astrotomic')->createURL('logo.png');
// https://img.astrotomic.info/logo.png?s=200c1c2065023265285dcbc4eff99955
bash
php artisan vendor:publish --provider="Astrotomic\Imgix\ImgixServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="Astrotomic\Imgix\ImgixServiceProvider" --tag="views"