Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do i connect my image in laravel+js framework

Heyy guys, i am currently learning Laravel but using JS as the frontend

its basic but i struggling with it 🙁

The code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

            <div className='hexagonal'>
                <img src="../../public/img/Hexagonal1.webp" alt="Hexagon" />
            </div>
            <div className='firstpage'>

but when i check the frontend, the image is crashing and when i check the console its always 404 not Found.

my image is inside the public/img folder , and my code is inside resources/js/Pages/Homepage.jsx , the image is below so you guys can check the folder tree structure

Folder Tree

i appreciate any help, thank you so much !

>Solution :

Perhaps change ../../public/img to ../../../img or if public is in the root /public/img

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading