Skip to content

Commit

Permalink
Removing tags as soon as intro uses as seo description. Remove unnece…
Browse files Browse the repository at this point in the history
…ssary spaces
  • Loading branch information
andrii-trush committed Jun 9, 2024
1 parent 95ee831 commit 131555e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Models/Concerns/HasSEOAttributesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 131555e

Please sign in to comment.