mardi 3 novembre 2020

How to access folders outside root directory in laravel? to be fetched with Vue

I'm trying to build a project. This project is contained in 2 seperate folders. The back-end is using laravel and the front-end is using Vue. The problem is, I need to fetch photos with vue from the laravel folder. Here is the project structure:

  • Project Folder
    • Laravel Folder
      • Media Folder (Contains images to be fetched with Vue)
    • Vue Folder

Currently here is the set up. When I execute the controller in laravel, it default accesses it's own public folder and creates a folder called media. is there a way to create a path for laravel that is outside it's own root folder?

What I'd like to happen is to set the upload path outside of the laravel folder and into the Vue folder so that Vue can fetch the data. Alternatively, If we could find a way where Vue can access files outside of it's own directory, that could be a solution too.

$upload_path = 'media';


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire