sharing storage path between domain and sub domain
i have two project on shared hosting one admin panel and another website . main site is on /public_html directory and another on /admin/adminsection
all the file need to fetched and upload in /public_html laravel project directory where main site is hosted.
like main site :example.com located at public_html
like admin site at admin.example.com
when i upload file from admin.example.com file should stored in example.com storage_path and also fetched from example.com storage_path
how can i do that
for example i can have many server one for web application one for mobile api one for admin portal and all there should have file stored in either of server
@smacy first remove the folder /path_to_main_site/storage/app/public/ completely in your admin subsite and then edit your links in filesystems configuration file for admin subsite like this:
'links' => [
storage_path('app/public') => '/path_to_main_site/storage/app/public/',
public_path('storage') => storage_path('app/public'), //should be already there
],
then run php artisan storage:link in the admin subsite. but no guarantee, just try that and you will see