spatie / laravel-medialibrary

Associate files with Eloquent models
https://spatie.be/docs/laravel-medialibrary
MIT License
5.78k stars 1.08k forks source link

Media on S3 compatible does not get deleted #3685

Closed nezaboravi closed 3 months ago

nezaboravi commented 3 months ago

Hello, Looks like I have all set properly, and files are getting uploaded on DO Spaces.

With previous ( I think previous media library) library removing and uploading works.

Now, is little bit changed in version 11, so we are using as per documentation, $media->delete();

However, file is not really deleted from DO spaces. It si removed from Media model tho. Note that uploading does work.

Here is the piece of code:

try {
            $media->delete();

        } catch (\Exception $e) {
            Log::info($e->getMessage());
            return response()->json(['message' => 'Failed to delete media'], 500);
        }

No error is catch, but media is still on DO, not removed.