media = $media; } public function handle() { $media = $this->media; $path = $media->media_path; $thumb = $media->thumbnail_path; if(!$path) { return 1; } $e = explode('/', $path); array_pop($e); $i = implode('/', $e); if(config_cache('pixelfed.cloud_storage') == true) { $disk = Storage::disk(config('filesystems.cloud')); if($path && $disk->exists($path)) { $disk->delete($path); } if($thumb && $disk->exists($thumb)) { $disk->delete($thumb); } } $disk = Storage::disk(config('filesystems.local')); if($path && $disk->exists($path)) { $disk->delete($path); } if($thumb && $disk->exists($thumb)) { $disk->delete($thumb); } $media->delete(); return 1; } }