public function uploadImage(ImageUploadRequest $request)
    {
        $image_name = $this->resizeAndSaveImage($request->file('upload'));
        $path = config('app.url').'/uploads/posts/'.$image_name;
        $func = $request->get('CKEditorFuncNum');
        $result = "<script>window.parent.CKEDITOR.tools.callFunction($func, '$path', 'Image has been uploaded')</script>";

        return $result;
    }
public function uploadImage(ImageUploadRequest $request)
    {
        $image_name = $this->resizeAndSaveImage($request->file('upload'));
        $path = config('app.url').'/uploads/posts/'.$image_name;
        $func = $request->get('CKEditorFuncNum');
        $result = "<script>window.parent.CKEDITOR.tools.callFunction($func, '$path', 'Image has been uploaded')</script>";

        return $result;
    }
public function uploadImage ( ImageUploadRequest $ request ) { $ image_name = $ this -> resizeAndSaveImage ( $ request -> file ( 'upload' ) ) ; $ path = config ( 'app.url' ) . '/uploads/posts/' . $ image_name ; $ func = $ request -> get ( 'CKEditorFuncNum' ) ; $ result = "<script>window.parent.CKEDITOR.tools.callFunction($func, '$path', 'Image has been uploaded')</script>" ; return $ result ; }
Function to upload images using
the SKEditor

note: no CSRF protection on the route that is
calling this function because we are using the
CKEditor within an iframe :(

@param \jorenvanhocht\Blogify\Requests\ImageUploadRequest $request
@return string
Function to upload images using the SKEditor