Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Cushty's avatar
Level 4

Spatie media digital ocean spaces, folders

Hi, I have got DO spaces working well with filament and spatie media, the only issue is it is not uploading to the directory set: images/local They are just being saved in no folder at all, just on the top level in DO. hope you can help, thanks

SpatieMediaLibraryFileUpload::make('avatar')
                        ->directory('images/' . config('filesystems.disks.do.directory_env'))
                        ->collection('avatars')
                        ->label('Avatar')
                        ->avatar()
                        ->required()
                        ->imageEditor()
                        ->disk('do'),
'do' => [
            'driver' => 's3',
            'key' => env('DO_ACCESS_KEY_ID'),
            'secret' => env('DO_SECRET_ACCESS_KEY'),
            'region' => env('DO_DEFAULT_REGION'),
            'bucket' => env('DO_BUCKET'),
            'url' => env('DO_URL'),
            'endpoint' => env('DO_ENDPOINT'),
            'directory_env' => env('DO_DIRECTORY'),
            'use_path_style_endpoint' => env('DO_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => false,
            'bucket_endpoint' => true,
            'visibility' => 'public',
        ],
DO_DIRECTORY=local
0 likes
1 reply

Please or to participate in this conversation.