From 131555e9474e95443e0b5db672e38a3837f41478 Mon Sep 17 00:00:00 2001 From: Andrii Trush Date: Mon, 10 Jun 2024 00:32:03 +0200 Subject: [PATCH] Removing tags as soon as intro uses as seo description. Remove unnecessary spaces --- src/Models/Concerns/HasSEOAttributesTrait.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Models/Concerns/HasSEOAttributesTrait.php b/src/Models/Concerns/HasSEOAttributesTrait.php index 2e38720..d6bb6ec 100644 --- a/src/Models/Concerns/HasSEOAttributesTrait.php +++ b/src/Models/Concerns/HasSEOAttributesTrait.php @@ -3,6 +3,7 @@ namespace Statikbe\FilamentFlexibleContentBlocks\Models\Concerns; use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Support\Str; use Spatie\Image\Enums\Fit; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\MediaLibrary\MediaCollections\Models\Media; @@ -46,10 +47,10 @@ public function getSEOTitle(): ?string public function getSEODescription(): ?string { if (! $this->seo_description && isset($this->intro)) { - return $this->intro; + return Str::squish(strip_tags($this->intro)); } - return $this->seo_description; + return Str::squish($this->seo_description); } protected function registerSEOImageMediaCollectionAndConversion()