ssuhat
ssuhat

Reputation: 7656

Laravel filesystem outside project

Can I use laravel filesystem to save file outside current project? I have this structure: project and cdn.

I've tried custom driver but fails. It wont put any file at cdn folder.

'custom' => [
        'driver' => 'local',
        'root'   => '~/Code/cdn.web/storage',
    ],

$store  = Storage::disk('custom')->put('index.txt', 'contents');

I've followed this answer too Storing files outside the Laravel 5 Root Folder But there is no custom driver.

Is there anyway to make it working?

Thanks

Upvotes: 3

Views: 3063

Answers (1)

ssuhat
ssuhat

Reputation: 7656

Found the answer.

Laravel doesn't support ~ on the path.

I need to put full path to make it working.

'custom' => [
    'driver' => 'local',
    'root'   => '/home/vagrant/Code/cdn.web/storage',
],

Upvotes: 4

Related Questions