dimanche 28 février 2021

Laravel Access the public folder of other Laravel Project

I am trying to build the admin panel in Laravel for a live website that is also in Laravel. I want to access the public folder of another Laravel project.

I tried this code:

public static function CustomerPublic(string $string)
    {
        if(env('APP_ENV')=='local'){
            return __DIR__.'/custom_dir/'.$string; 
        }
    }

The issue I am facing: It starts the file with root-like 127.0.0.1

I am looking for a way to access the dir of another laravel project from the current project.

Edit: My Dir structure

return __DIR__.'/../../../web_vue/public/'.$string;

Result I got:

http://127.0.0.1:8000/media/alihyder/7E74636D746326DD/Projects/PatientCare/web_vue/public/uploads/images/banner_1.jpg   

Result I want:

file:///media/alihyder/7E74636D746326DD/Projects/PatientCare/web_vue/public/uploads/images/banner_1.jpg



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire