I think you can, but you shouldn't use the storage_path helper in that case.
File Storage outside Laravel folder
Is it possible to create a local disk to store files, outside the /storage folder within Laravel root directory? In my case I want to store the files on a secondary disk on the same server:
Update: This is an entry in filesystem.php
'MyApp' => [ 'driver' => 'local', 'root' => storage_path('/opt/MyApp/files'), ],
But this stored the files in <laravel_app_path>/storage/opt/MyApp/files. Not what I needed.
Thanks.
No, the 'root' can be any folder - including non-local (S3)
using storage_path is limiting you to that folder. The base_path() function returns your project root
'MyApp' => [
'driver' => 'local',
'root' => base_path('/files'),
],
or, anywhere in your operating system;
'MyApp' => [
'driver' => 'local',
'root' => '/opt/MyApp/files',
],
Please or to participate in this conversation.