PHP code example of jarda256sparktech / nova-image-cropper

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

    

jarda256sparktech / nova-image-cropper example snippets


use R64\NovaImageCropper\ImageCropper;

ImageCropper::make('Photo'),

use R64\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)

...

  "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"