PHP code example of ayvazyan10 / nova-imagic

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

    

ayvazyan10 / nova-imagic example snippets

` php
use Ayvazyan10\Imagic\Imagic;

public function fields(Request $request)
{
    return [
        // ...

        Imagic::make('Image', 'image'),

        // ...
    ];
}
` php
Imagic::make('Image')
    ->multiple()
    ->crop($width, $height, $left = 0, $top = 0)
    ->resize($width, $height)
    ->fit($width, $height)
    ->widen($width)
    ->quality($quality)
    ->disk($path)
    ->directory($path)
    ->convert($convert = true)
    ->watermark($path, $position = 'bottom-right', $x = 0, $y = 0);
 php
Imagic::make('Images')->multiple(),
 php
Imagic::make('Image')->crop($width, $height, $x, $y),
 php
Imagic::make('Image')->resize($width = int|null, $height = int|null),
 php
Imagic::make('Image')->quality(90),
 php
Imagic::make('Image')->convert(false),
 php
Imagic::make('Image')->fit($width, $height),
 php
Imagic::make('Image')->watermark('/path/to/watermark.png', 'bottom-right', 15, 15),
 php
Imagic::make('Image')->disk('public')
 php
Imagic::make('Image')->directory('your/custom/directory')