Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

femmor2u's avatar

Blade Template Image URL link in DB concatenated to external link

Hello Guys!

I have some images in the database that are also on another website but I only want to fetch the beginning url from that website and concatenate it to the url in my local database.

For example: Blade Template {{ $user->ImageSrc }} - This is the blade template url link for the image in my database

External url: www.example.com/ - this is the link I want to concatenate.

Together I want to do something like

< img src="http://www.example.com/". {{ $user->ImageSrc }}>

is this possible? and can someone help with this? I will greatly appreciate.

0 likes
3 replies
chrisbraybrooke's avatar

You could also add a SRC_URL variable to your .ENV file and then use what @topvillas wrote in your blade template.

<img src="{{ env('SRC_URL') }}{{ $user->ImageSrc}}">

1 like

Please or to participate in this conversation.