PHP code example of anahkiasen / illuminage

1. Go to this page and download the library: Download anahkiasen/illuminage 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/ */

    

anahkiasen / illuminage example snippets


'Illuminage\IlluminageServiceProvider',

'Illuminage' => 'Illuminage\Facades\Illuminage',

// This will create a cropped 200x300 thumb, cache it, and display it in an image tag
echo Illuminage::thumb('image.jpg', 200, 300)
// or
echo Illuminage::image('image.jpg')->thumbnail(200, 300)

// Shortcuts
echo Illuminage::square('image.jpg', 300)

$thumb = Illuminage::square('image.jpg', 200)->addClass('image-wide');
$thumb = $thumb->wrapWith('figure')->id('avatar');

echo $thumb;
// <figure id="avatar"><img class="image-wide" src="pathToThumbnail.jpg"></figure>

$thumb = Illuminage::image('foo.jpg')->thumbnail(200, 200);

echo $thumb->grayscale()->onImage(function($image) {
  $image->flipVertically()->rotate(45);
});