How to set storage path for main domain from sub domain - Laravel

19 Views Asked by At

I have issue on create storage path for access main domain file from sub domain project. main domain - https://etest.com sub domain - https://recovey-test.com

Files will uploaded to recovey-test.com by API and need to show those files in https://etest.com admin panel.

This is the previously I get file direct from main domain when admin panel was developed in main domain.

This is the previously I get file direct from main domain when admin panel was developed in main domain.

1

There are 1 best solutions below

0
Ayoub Kuvi On

In your subdomain project you could create a new "disk" in config/filesystem.php :

'public_html' => [
'driver' => 'local',
'root' => '/home/onomy/public_html/storage',
'url' => env('PUBLIC_URL').'/storage', // should point to your main project
'visibility' => 'public',

],

You should do then all file operations through this disk. Hope I got your question right and this helps.