Moenchfracht
11 months ago
205
10
Laravel

Filesystem disk per user

Posted 11 months ago by Moenchfracht

Hello, I'm thinking about a solution to store files for authenticated user in separate directories. I was trying to use the 'disks' in the filesystem.php like this. But it was not working. Is this a good idea to store files like this, and how can I do it in a "laravel-style"?

        'userdisk'=> [
            'driver' => 'local',
            'root' => storage_path('app/public/'.\App\Auth::user()->name.'/'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

Thanks!

Please sign in or create an account to participate in this conversation.