PHP code example of soundsmarket / nova-image-cropper

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

    

soundsmarket / nova-image-cropper example snippets


use SoundsMarket\NovaImageCropper\ImageCropper;

ImageCropper::make('Photo'),

use SoundsMarket\NovaImageCropper\ImageCropper;

ImageCropper::make('Photo')
        ->preview(function () {
            if (!$this->value) return null;

            $url = Storage::disk($this->disk)->url($this->value);
            $filetype = pathinfo($url)['extension'];
            return 'data:image/' . $filetype . ';base64,' . base64_encode(file_get_contents($url));
        });

ImageCropper::make('Photo')->avatar()

ImageCropper::make('Photo')->aspectRatio(16/9)

ImageCropper::make('Photo')->aspectRatio(0)

...

  "Edit Image": "Editar Imagen",
  "Cancel Crop": "Cancelar Recorte",
  "Change Image": "Cambiar Imagen",
  "Done": "Hecho",
  "Click here or drop the file to upload": "Click aquí o arrastra el archivo para comenzar la subida"