PHP code example of ctessier / nova-advanced-image-field

1. Go to this page and download the library: Download ctessier/nova-advanced-image-field 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/ */

    

ctessier / nova-advanced-image-field example snippets


// Show a cropbox with a fixed ratio
AdvancedImage::make('Photo')->croppable(16/9),

// Resize the image to a max width
AdvancedImage::make('Photo')->resize(1920),

// Override the image processing driver for this field only
AdvancedImage::make('Photo')->driver('imagick'),

AdvancedAvatar::make('Avatar')->croppable(),
AdvancedImage::make('Avatar')->croppable()->rounded(),

AdvancedImage::make('Photo')->driver('imagick'),

AdvancedImage::make('Photo')->croppable(),
AdvancedImage::make('Photo')->croppable(16/9),

AdvancedImage::make('Photo')->resize(1920),
AdvancedImage::make('Photo')->resize(600, 400),
AdvancedImage::make('Photo')->resize(null, 300),

AdvancedImage::make('Photo')->autoOrientate(),

AdvancedImage::make('Photo')->resize(600, 400)->quality(95),

AdvancedImage::make('Photo')->convert('webp'),