PHP code example of astrotomic / laravel-weserv-images

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

    

astrotomic / laravel-weserv-images example snippets


use Astrotomic\Weserv\Images\Enums\Fit;

echo weserv('https://images.weserv.nl/lichtenstein.jpg')
    ->w(512)
    ->h(512)
    ->we()
    ->fit(Fit::INSIDE);
// https://images.weserv.nl/?w=512&h=512&we=1&fit=inside&url=https%3A%2F%2Fimages.weserv.nl%2Flichtenstein.jpg
bash
php artisan vendor:publish --provider="Astrotomic\Weserv\Images\Laravel\WeservImagesServiceProvider" --tag=config