PHP code example of le0daniel / laravel-image-engine

1. Go to this page and download the library: Download le0daniel/laravel-image-engine 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/ */

    

le0daniel / laravel-image-engine example snippets


use Carbon\Carbon;use le0daniel\Laravel\ImageEngine\Image\ImageRepresentation;

$image = ImageRepresentation::from(
    'file/path/relative/to/disk',
    'medium', // Desired image size defined in config
    null,     // Expire Timestamp or Carbon
    'local'   // name of the storage disk where the image is located
);

$imgUrl = image_url($image, 'png' /* Desired output format: jpg | png */);

image_real_path($image, 'png');