52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\Models\IsCachedAsCollection;
|
|
use Domain\Enums\StaticPageSlug;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property StaticPageSlug $slug
|
|
* @property string $seo_title
|
|
* @property string $seo_description
|
|
* @property string|null $title
|
|
* @property string $content
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
*
|
|
* @mixin \Eloquent
|
|
*/
|
|
#[Fillable([
|
|
'seo_title',
|
|
'seo_description',
|
|
'title',
|
|
'content',
|
|
])]
|
|
#[Guarded([
|
|
'slug',
|
|
])]
|
|
class Page extends Model
|
|
{
|
|
/** @use \App\Traits\Models\IsCachedAsCollection<self> */
|
|
use IsCachedAsCollection;
|
|
|
|
#[\Override]
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return 'slug';
|
|
}
|
|
|
|
#[\Override]
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'slug' => StaticPageSlug::class,
|
|
];
|
|
}
|
|
}
|