PHP code example of renatomiguelsantos / imagify-laravel

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

    

renatomiguelsantos / imagify-laravel example snippets


use Imagify;

$handle = Imagify::optimize('path_to_image', [
    'level' => 'ultra',
    'resize' => [
        'width' => '1560',
    ],
]);

if (true === $handle->success) {
    $contents = file_get_contents($handle->image);
}
shell
php artisan vendor:publish --provider="Imagify\Laravel\ServiceProvider"