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

afoysal's avatar

Display image in vue.js

I am trying to develop a SPA. In this regard I am using vue.js 2 in front end and Laravel 5.5 API in back end. Now I would like to display images in front end. I wrote below code in HTML

<img :src="/images/addressObj.image"/>

Where should I put images in Laravel and how can I access that image in vue.js ?

0 likes
9 replies
MaverickChan's avatar

@afoysal

  1. store your image FILE at some path on your server.

2.store your image PATH into database.

1 like
burlresearch's avatar

Your localhost:8000 is pointing to the index.html file in /public from your project root directory.

So to store the image, such that localhost:8000/assets/images/default.jpg will work, it would have to sit in a directory:

{proj_root}/public/assets/images/default.jpg

You could also use a helper method with:

$url = asset('assets/images/default.jpg');

5 likes
britez13's avatar

@burlresearch Thank you so much, sir. I've been struggling with this all day and your response completely solved my problem.

Please or to participate in this conversation.