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 to use {{}} inside of asset helper laravel

I have a dynamic image that a user can change, so I need to grab the path from the database. Everything works fine if I do:

<img src="/storage/{{ $client->image->path }}">

But this doesn’t work:

<img src="{{ asset('/storage/{{ $client->image->path }}') }}">

Thank you for your help

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

>Solution :

You’ve already opened the curly braces once. You can process it in accordance with the syntax. Try like this:

<img src="{{ asset('/storage/' . $client->image->path) }}">
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