Files
ntspi-app/app/Ship/Traits/HasSeo.php
T
2025-05-25 19:01:00 +05:00

27 lines
503 B
PHP

<?php
namespace App\Ship\Traits;
use App\Ship\Models\Seo;
use Illuminate\Database\Eloquent\Relations\MorphOne;
trait HasSeo
{
public function seo(): MorphOne
{
return $this->morphOne(Seo::class, 'seoable');
}
public function prepareDescription(string $description): array
{
return [
[
'type' => 'paragraph',
'data' => [
'content' => $description,
],
]
];
}
}