Adding Custom path for storage in filesystems.php Laravel

Viewed 2522

I want to add a path "C:\Folder" for storage purposes in filesystems.php

When I use the below code I get an error:

Driver [] is not supported. 

Code:

'c_path' => [
    'driver' => 'local',
    'root' => "C:/Folder/",
],

So how to solve this problem? Can someone please suggest me a solution?

1 Answers

From terminal run,

composer require league/flysystem

In your file filesystems.php file

   'c_path' => [
        'driver' => 'local',
        'root' => 'C:\uploads'
    ],

then for store your file,

Storage::disk('c_path')->put('picture.png', $request->file('picture'));
Related