PHP code example of othercode / img-fly

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

    

othercode / img-fly example snippets


OtherCode\ImgFly\ImgFlyServiceProvider::class,

'ImgFly' => OtherCode\ImgFly\Facades\ImgFlyFacade::class,

[
    "icon" => "?w=60&h=60&fit=crop-center",
    "small" => "?w=100&h=100&fit=crop-center",
    "thumbnail" => "?w=200&h=200&fit=crop-center",
    "medium" => "?w=600&h=400&fit=crop-center",
    "large" => "?w=1200&h=600&fit=crop-center",
];
html
<img src="{{ ImgFly::imgFly('apple-mouse.jpeg?w=500') }}" alt="">
html
<img src="{{ ImgFly::imgPublic('hands.jpeg?w=500', 'img') }}" alt="">
bash
php artisan vendor:publish --tag=config
html
<img src="{{ ImgFly::imgPreset('hands.jpg', 'icon') }}" alt="">
<img src="{{ ImgFly::imgPreset('hands.jpg', 'small') }}" alt="">
<img src="{{ ImgFly::imgPreset('hands.jpg', 'thumbnail') }}" alt="">