postitief's avatar

Write custom filesystem disk

Hello,

I want to store files outside the Laravel installation directory. So I made my own 'filedriver' like this:

    'disks' => [
       // exisiting file drivers here

        'bb' => [
            'driver' => 'bb',
            'root' => base_path().'../image'
        ],

    ],

But when I try to upload a file with this:

$path = $request->file('file')->store('upload', 'bb');

I get this error:

InvalidArgumentException in FilesystemManager.php line 121:
Driver [bb] is not supported.

How do I get this fixed?

Note: Laravel is installed in: /var/www/laravel/ And upload should go to /var/www/image/

0 likes
0 replies

Please or to participate in this conversation.