jeudi 2 juillet 2020

uploading images to one folder using two laravel websites

i have 2 different laravel projects using same database as an example here firstwebsite.com secondwebsite.com

in the secondwebsite.com users can register through a form by uploading images and videos to a storage folder and in the firstwebsite.com that registered users is listed along with the profile images which i am fetching from secondwebsite.com. Both websites have separate admin dashboards and admin can edit profiles of the users. now i want admin of the firstwebsite.com to have an option to edit the registered users profile which i already did but only have an issue of images and videos to update because if i update the images then it is stored in firstwebsite.com and i want it to be stored in the storage directory of secondwebsite.com

below is some of my code.to upload images from secondwebsite.com

               foreach ($request->file('picture') as $picture) {
                 $pictures[] = $fileName = time().$picture->getClientOriginalName();
                 Storage::put('public/'.$fileName,file_get_contents($picture));
               }

configuration of filesystem in config/filesystem.php

 'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],
    ]


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire