39 lines
728 B
PHP
39 lines
728 B
PHP
<?php
|
|
|
|
namespace App\Domain\Cms;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PageRevision extends Model
|
|
{
|
|
public const UPDATED_AT = null;
|
|
|
|
protected $fillable = [
|
|
'page_id',
|
|
'blocks',
|
|
'seo_title',
|
|
'seo_description',
|
|
'created_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'blocks' => 'array',
|
|
'created_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function page(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Page::class);
|
|
}
|
|
|
|
public function author(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|