image->path; if (str_ends_with($original, '.webp') && str_starts_with(basename($original), 'banner-')) { return; // Already done. } try { $prepared = $banner->prepare($original); } catch (Throwable $error) { Log::warning('Banner photo could not be prepared; the uploaded photo stays in use.', [ 'store_image_id' => $this->image->id, 'error' => $error->getMessage(), ]); return; } $this->image->update(['path' => $prepared]); Storage::disk('public')->delete($original); } }