PHP code example of webkinder / sproutset

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

    

webkinder / sproutset example snippets


'image_sizes' => [
    'large' => [
        'width' => 1024,
        'height' => 1024,
        'crop' => false,
        'srcset' => [0.5, 2],
    ],
],

'avif' => [
    'enabled' => false, // opt-in
    'quality' => 50,    // 0–100
],

'focal_point' => true,

'defer_generation' => false,
blade
<x-sproutset-image :attachment-id="$id" size-name="large" />