protected function saveImage($imageFile, $image)
    {
        // Trigger before save hook
        $this->triggerBeforeSaveHook($image);

        $imageQuality = array_get(
            $this->uploadFieldOptions,
            'resize_image_quality',
            config('imageup.resize_image_quality')
        );

        $imagePath = $this->getFileUploadPath($imageFile);

        $this->getStorageDisk()->put(
            $imagePath,
            (string)$image->encode(null, $imageQuality),
            'public'
        );

        // Trigger after save hook
        $this->triggerAfterSaveHook($image);

        // clean up
        $image->destroy();

        return $imagePath;
    }
protected function saveImage($imageFile, $image)
    {
        // Trigger before save hook
        $this->triggerBeforeSaveHook($image);

        $imageQuality = array_get(
            $this->uploadFieldOptions,
            'resize_image_quality',
            config('imageup.resize_image_quality')
        );

        $imagePath = $this->getFileUploadPath($imageFile);

        $this->getStorageDisk()->put(
            $imagePath,
            (string)$image->encode(null, $imageQuality),
            'public'
        );

        // Trigger after save hook
        $this->triggerAfterSaveHook($image);

        // clean up
        $image->destroy();

        return $imagePath;
    }
protected function saveImage ( $ imageFile , $ image ) { // Trigger before save hook $ this -> triggerBeforeSaveHook ( $ image ) ; $ imageQuality = array_get ( $ this -> uploadFieldOptions , 'resize_image_quality' , config ( 'imageup.resize_image_quality' ) ) ; $ imagePath = $ this -> getFileUploadPath ( $ imageFile ) ; $ this -> getStorageDisk ( ) -> put ( $ imagePath , ( string ) $ image -> encode ( null , $ imageQuality ) , 'public' ) ; // Trigger after save hook $ this -> triggerAfterSaveHook ( $ image ) ; // clean up $ image -> destroy ( ) ; return $ imagePath ; }
Save the image to disk

@param $imageFile
@param $image
@return string
@throws \Exception
Save the image to disk