PHP code example of anakadote / image-manager

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

    

anakadote / image-manager example snippets


<img src="{{ ImageManager::getImagePath(public_path() . '/img/' . $image->filename, 250, 200, 'crop') }}" alt="">




$unique_filename = ImageManager::getUniqueFilename($filename, public_path() . '/img/');




ImageManager::deleteImage(public_path() . '/img/' . $image->filename);

html
<picture>
    <source srcset="{{ ImageManager::getImagePath(public_path() . '/img/' . $image->filename, 250, 200, 'crop', 90, 'webp') }}" type="image/webp">
    <img src="{{ ImageManager::getImagePath(public_path() . '/img/' . $image->filename, 250, 200, 'crop') }}" alt="">
</picture>