Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Flex's avatar
Level 4

unable to see uploaded image preview in Editor.js on Vue Js 3

working with Laravel 10 and Vue Js 3 with Editor.js in my blog app. I have following createBlog.vue file with embedded Editor.js

and controller for createBlog is

//upload Editor Image function
    public function uploadEditorImage(Request $request) {
        $this->validate($request, [
            'image' => 'required|mimes:jpeg,jpg,png',
        ]);
        $picName = time().'.'.$request->image->extension();
        $request->image->move(public_path('uploads'), $picName);
        return response()->json([
            'success' => 1,
            'file' => [
                'url' => "http://localhost:8000/uploads/$picName"
            ]
        ])->header('Content-Type', 'application/json');
       // return $picName;
    }

web.php is

Route::post('createBlog',[AdminController::class,'uploadEditorImage']);

now I need when I uploaded an image via editor preview of the image on the editor. but currently editor uploaded image to public/uploads folder successfully but not preview image on the editor then how could I fix this problem here?
0 likes
0 replies

Please or to participate in this conversation.