Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get image from different project on the laravel?

I have two project or url

First url like this :

http://myshop.dev/

Second url like this :

http://backend.myshop.dev/

If the second url, I run this :

<img src="{{ asset('img/$photo }}"/>

It will call url :

http://backend.myshop.dev/img/image1.jpg

It did not suit my needs

I want to take the image in the first url (http://myshop.dev/img/image1.jpg)

Both projects use the same database

How can I do it?

like image 882
moses toh Avatar asked Dec 09 '25 10:12

moses toh


1 Answers

Add this to your .env

BACKEND_URL=http://backend.myshop.dev/public/

Call

<img src="{{ env('BACKEND_URL') . "{img/$photo}"}}"/>
like image 101
Edvard Åkerberg Avatar answered Dec 10 '25 23:12

Edvard Åkerberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!