File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,14 @@ public function delete(Media $media): bool
161161 return false ;
162162 }
163163
164- $ this ->filesystem ->deleteDirectory ($ media ->disk , $ media ->dir_relative_path );
164+ if (config ("filesystems.disks. $ media ->disk .driver " ) === 's3 ' ) {
165+ $ this ->filesystem ->deleteFile ($ media ->disk , array_filter ([
166+ $ media ->original_relative_path ,
167+ $ media ->preview_relative_path ,
168+ ]));
169+ } else {
170+ $ this ->filesystem ->deleteDirectory ($ media ->disk , $ media ->dir_relative_path );
171+ }
165172
166173 return true ;
167174 });
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ protected function isPdf(): Attribute
152152
153153 private function makeUrl (string $ path ): string
154154 {
155- $ visibility = config ("filesystems.disks. { $ this ->disk } .visibility " );
155+ $ visibility = config ("filesystems.disks. $ this ->disk .visibility " );
156156
157157 if ($ visibility === Filesystem::VISIBILITY_PUBLIC ) {
158158 return Storage::disk ($ this ->disk )->url ($ path );
You can’t perform that action at this time.
0 commit comments