public function cropPhotos($event)
    {
        $this->filesystem = config('admin.storage.disk');
        $this->folder = config('admin.images.cropper.folder') . '/' . $event->slug;
        $this->quality = config('admin.images.cropper.quality', 100);

        $this->request = $event->request;
        $this->dataType = $event->dataType;
        $this->model = $event->model;

        $cropperImages = $this->dataType->rows()->whereType('image')
            ->where('details', 'like', '%cropper%')->get();

        foreach ($cropperImages as $dataRow) {
            $details = json_decode($dataRow->details);

            if (!isset($details->cropper)) {
                continue;
            }

            if (!$this->request->{$dataRow->field}) {
                continue;
            }

            $this->cropPhoto($details->cropper, $dataRow);
        }

        return true;
    }
public function cropPhotos($event)
    {
        $this->filesystem = config('admin.storage.disk');
        $this->folder = config('admin.images.cropper.folder') . '/' . $event->slug;
        $this->quality = config('admin.images.cropper.quality', 100);

        $this->request = $event->request;
        $this->dataType = $event->dataType;
        $this->model = $event->model;

        $cropperImages = $this->dataType->rows()->whereType('image')
            ->where('details', 'like', '%cropper%')->get();

        foreach ($cropperImages as $dataRow) {
            $details = json_decode($dataRow->details);

            if (!isset($details->cropper)) {
                continue;
            }

            if (!$this->request->{$dataRow->field}) {
                continue;
            }

            $this->cropPhoto($details->cropper, $dataRow);
        }

        return true;
    }
public function cropPhotos ( $ event ) { $ this -> filesystem = config ( 'admin.storage.disk' ) ; $ this -> folder = config ( 'admin.images.cropper.folder' ) . '/' . $ event -> slug ; $ this -> quality = config ( 'admin.images.cropper.quality' , 100 ) ; $ this -> request = $ event -> request ; $ this -> dataType = $ event -> dataType ; $ this -> model = $ event -> model ; $ cropperImages = $ this -> dataType -> rows ( ) -> whereType ( 'image' ) -> where ( 'details' , 'like' , '%cropper%' ) -> get ( ) ; foreach ( $ cropperImages as $ dataRow ) { $ details = json_decode ( $ dataRow -> details ) ; if ( ! isset ( $ details -> cropper ) ) { continue ; } if ( ! $ this -> request -> { $ dataRow -> field } ) { continue ; } $ this -> cropPhoto ( $ details -> cropper , $ dataRow ) ; } return true ; }
Save cropped photos.

@param Illuminate\Http\Request                 $request
@param string                                  $slug
@param Illuminate\Database\Eloquent\Collection $dataType
@param Illuminate\Database\Eloquent\Model      $model

@return bool
Save cropped photos .