Lano Angel
Lano Angel

Reputation: 309

Adding Custom path for storage in filesystems.php Laravel

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?

Upvotes: 5

Views: 3697

Answers (1)

Md.Sukel Ali
Md.Sukel Ali

Reputation: 3065

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'));

Upvotes: 6

Related Questions