PHP code example of cviebrock / image-validator

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

    

cviebrock / image-validator example snippets


'providers' => [
    ...
    \Cviebrock\ImageValidator\ImageValidatorServiceProvider::class,
],

$rules = [
    'my_image_field' => 'image_size:<width>[,<height>]',
];

$rules = [
    'my_image_field' => 'image_aspect:<ratio>',
];

// logo must be 300px wide by 400px tall
$rules = [
    'logo' => '  'logo' => 'les = [
    'logo' => 'be ready for the big screen TV :)
$rules = [
    'logo' => '