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!

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

2 Comments

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 ?
Maybe, this question can gives you a brief description stackoverflow.com/questions/32810231/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.