link domain and sub domain storage path like main site is on example.com and admin portal is in admin.example.com , when i do crud from admin.example.com file should be stored/updated/deleted/fetched at example.com directory how can i create symlink or achive like that...
i am using shared shared hosting how can i achive that
example.com=> /home/username/public_html directory
admin.example.com=>/home/username/admin/admin_directory
please help some body
@freemium Create the symlink pointing to where it needs to be.
@martinbean
what i did was
Route::get('/link', function () {
$target = '/home/user12/test/mainsite/storage/app/images';
$shortcut = '/home/user12/test/adminsite/public/images';
symlink($target, $shortcut);
it created symlink but when i upload product it gets stored in adminsite directry i wanto store in and retrive from mainsite directory
@martinbean
how can i symlink
$target = '/home/user12/public_html/storage/app/images';
$shortcut = '/home/user12/test/adminsite/public/images';
can you illustrate with code please i did lot of research and i couldnot found...
@freemium
From the link provided by @martinbean , you just need to add your configuration to the array
Example:
'links' => [
public_path('storage') => storage_path('app/public'),
'target location'=>'source location',
public_path('images')=>'/home/user12/test/adminsite/public/images',
],
After that, running the command php artisan storage:link will create the symlink folder based on the array.
@frankielee
when uploading file in admin.example.com will it be available in example.com
Please sign in or create an account to participate in this conversation.