Uploading image outside the LARAVEL folder

0

Good afternoon, I have a question, is it possible for me to upload an image in laravel out of the project folder? Well I have a project that the site folder is out of the laravel folder and I need to display images uploaded to laravel on this site.

\WWW\
     DESTINO_IMAGEM\
     LARAVEL\
    
asked by anonymous 16.05.2018 / 21:04

1 answer

0

I did not test, but I believe you can create a new disk with root pointing to this folder outside of laravel.

The disks work as a way to tell you how you will store them, and can be on the local file system (using local as your driver ) or even in the cloud (eg aws s3)

How to configure

Disk configurations are in the config/filesystems file and you just add one more item to the disks array. An example for your case would be:

'disks' => [
    ...
    'pasta_externa' => [
        'driver' => 'local',
        'root' => '/var/www/DESTINO_IMAGEM'
    ]
]
    
16.05.2018 / 22:42