Quasar / Vue.js Image in header not showing - image

Im really new to Vue.js and Quasar and am currently trying to build just a basic application.
In there i have a header which should display a logo on the top left using the following code in my MainLayout.Vue.
<q-layout view="hHh LpR fFf">
<q-header elevated class="bg-accent text-white">
<q-toolbar>
<q-toolbar-title>
<q-img src= "public/icons/favicon-16x16.png" style="width: 70px;">
</q-img>
Title
</q-toolbar-title>
</q-toolbar>
</q-header>
<q-page-container>
<router-view />
</q-page-container>
</q-layout>
It runs without an error, but the image is not displayed. At its position there is just a blank space. When i open up the JavaScript Console in my Browser,
Failed to load resource: the server responded with a status of 404 (Not Found)
The path is definitely right. Placing the image inside of the src/assets folder did not help as well.
I followed this tutorial, which lead me to the point im at now.
The only difference i can see is that the project in the tutorial uses the "static" folder for its image, however my project does not contain such "static" folder.
Googling i found that the "static" folder got turned into the "public" folder through some update.
But since i'm using the public folder for my code above, this seemingly either is not true or the issue is something else.
So how do i get my logo to be displayed top left in my header?

Related

Change document root of Laravel

When I place a Laravel project into Apache's document root, say /var/www/html, it works when I point a browser at it.
However if I put it under a directory under Apache's document root, for example /var/www/html/myProject, it doesn't work when I point a browser at it.
Is there anyway I can change this behavior?
Thank you very much.
Edit:
When I put the Laravel project off a sub-directory off /var/www/html, Laravel complained that it could not write to the file laravel.log. After checking and changing the group ownership of the sub-directory, the index page came up normally.
However, the background image was missing, even after I changed the URI in the CSS stylesheet.
Furthermore, when I clicked on any link from the index page, I got a 404 Not Found Error. This is an Apache 404 and not a Laravel 404, which is styled differently.
OTOH, if I run the PHP server off this sub-directory and point my browser at localhost:8000, the links serve up pages correctly.
Thank you for your help.

Image not loading in page on WAMP localhost 403 forbidden error, but clicking its link works

I have the following code in my localhost project in WAMP
<img src="/imgs/quickstartVideo.jpg" width="357" height="200" alt="quick start video">
The image won't appear - console says "403 (forbidden)". However, if I right click to view the page source, and click the image's link, the image appears.
The page loads js and css files that are using the same sort of relative URL.
Why does it tell me it's forbidden, yet lets me load it when I click it? How do I get it to just load please?
My dir structure is:
c:\wamp
c:\wamp\www
c:\wamp\www\imgs
c:\wamp\www\js (js files are loading fine)
UPDATE: it's displaying correctly in MS Edge, but not Chrome.
Thank you
Solved -the issue was an IfModule mod_rewrite I'd set up in htaccess to stop image hotlinking on my production domain. Commented it out for localhost development, and, funny enough, my images are working again.

I am new to the Laravel. I got this project and I don't know why this is not displaying pictures

Things I tried
1.simple path without URL::to
2.url() method
3.absolute path
4.asset(simple relative path)
in my .env file changed APP_URL from http://localhost to http://localhost:8000 since it runs on 8000 port
I am adding some pictures.
One thing which is important to mention here when i use Simple relative path it shows picture on hovering the mouse in IDE and on browser too but browser does not render it on webpage.
Please see pictures
src="{{URL::to('public/imgs/2.png')}}"
You have to put all your image resource files in public folder then access those resources through the following way:
src="{{ URL::asset('imgs/2.png') }}"

GET imageRoute 404 (Not Found) on Laravel

I have a Laravel project that I've mainly been working on it's back end, but now I copied the layouts from another project which has two images on the header. This is one of them:
<img class="img-logo" src="imagenes/temp_imgs/logo temporal.png">
The images on my old project are stored on public/imagenes/temp_imgs/, so I created those same folders on my new project and stored the images there. But when I run it I get the following error:
GET http://localhost:8000/competencias/imagenes/temp_imgs/logo%20temporal.png 404 (Not Found)
It seems as if it isn't looking for the images on my public folder but rather on the location of the view (competencias), the view is competencias/crear.blade.php
I don't remember much from the configuration on the old project, I only now I ran npm install on both at creation, so both have bootstrap and vue. But that's al I now, maybe you can help me see if a configuration file on the old project is making the image src point to the public folder, or figuring out what's generating the error.
EDIT:
If I paste one of the files from my old project to my new one the images are shown. If I rename one of the files from my new project and give it a name of a file from my old project the images are also shown! I hope this helps in figuring this thing out.
in laravel 5.4 you will not able to see image as your link
route will lock your every public folder
http://localhost:8000/competencias/imagenes/temp_imgs/logo%20temporal.png
just try to use like that
<img class="img-logo" src="{{ url('imagenes/temp_imgs/logo temporal.png') }}">
or
<img class="img-logo" src="{{ asset('imagenes/temp_imgs/logo temporal.png') }}">
You should use {{ asset('imagenes/temp_imgs/logo temporal.png') }}
For all assets use {{asset(....)}} to solve all problems that maybe appear for you
Hope help you

Localhost is no longer working properly

I just built a site using Xampp and it worked great. I just transferred my site (that I used to develop by updating to live server) to localhost, and it isn't working right at all.
The images do not show and the pages are not refreshing properly.
I had to change the CSS images to /folder/x instead of just x, which I can understand I guess, but why are my HTML images suddenly not working?
One of the pages, the paths are even absolute, but the page just isn't updating even though it's saved in the local folder.
What gives? All I did differently was added a password to root user in MySQL and tried (and failed) at some mod_rewrites, which I removed.
It points the images from localhost/ instead of localhost/folder, even adding folder/x doesn't work.
You probably forgot to convert a link or made a mistake.
Remember that /images/x.png means that it's trying to find the folder images from root and not from the current folder your site is located in. Try using ./images/x.png instead.
Perhaps you could post an example from your site?
Try looking at the Apache access logs and see whether you can find a request for an image with the wrong path.

Resources