0

I need to install Laravel 8 locally. The app is developed by other person and I my problem is that all links in admin part are invalid

Say in backend layout I have

<img class="width50" src="{!!admin_assets!!}/media/logo_new.png" />

This image is not rendered properly and in the source of the page I see

 <img class="width50" src="http://127.0.0.1:8000/assets/adminside/media/logo_new.png" />
     

This image is located in ProjectName/assets/adminside/media/logo_new.png (not under public)

In routes/web.php I see :

define('admin_assets', url('assets/adminside'));
//define('admin_assets', url('../assets/adminside')); // if to uncomment this line it does not work anyway

Any hint how it can be fixed?

Thanks!

shaedrich
  • 5,457
  • 3
  • 26
  • 42
mstdmstd
  • 2,195
  • 17
  • 63
  • 140

1 Answers1

1

The url helper generates a fully qualified URL to the given path like:

YOUR_DOMAIN.com/assets/adminside/YOUR_IMAGE.png

You can do it in 2 ways:

  1. Move your files in storage and use symlink to access these files
  2. Move your files to public directory
Abolfazl Mohajeri
  • 1,734
  • 2
  • 14
  • 26
  • Yes, moving assets under /public fixed it. Seems this app is working now on dev server of my client. That is not clear how it worked priorly. Are there any way to fix it without moving assets under /public ? – mstdmstd Jun 02 '21 at 07:08
  • Maybe, this question can gives you a brief description https://stackoverflow.com/questions/32810231/add-public-to-asset-path-in-laravel – Dilip Hirapara Jun 02 '21 at 07:13