cms/app/Models/Page.php
Funky Waddle 37ed997989 feat(cms): initialize Laravel project structure and core CMS files
- Added standard Laravel directory structure and configuration.

- Included Svelte and Tailwind configuration for the admin interface.

- Added core PHPUnit and testing scripts.
2026-04-13 12:48:06 -05:00

46 lines
825 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
use HasFactory;
protected $fillable = [
'title',
'slug',
'content',
'cached_html',
'meta_description',
'is_published',
'user_id',
];
protected function casts(): array
{
return [
'content' => 'array',
'is_published' => 'boolean',
];
}
/**
* Get the author of the page.
*/
public function author()
{
return $this->belongsTo(User::class, 'user_id');
}
/**
* Get the navigation item for the page.
*/
public function navigationItem()
{
return $this->hasOne(NavigationItem::class);
}
}