cms/app/Models/Post.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

36 lines
656 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
protected $fillable = [
'custom_post_type_id',
'user_id',
'title',
'slug',
'content',
'custom_fields_data',
'status',
'published_at',
];
protected $casts = [
'content' => 'array',
'custom_fields_data' => 'array',
'published_at' => 'datetime',
];
public function customPostType()
{
return $this->belongsTo(CustomPostType::class);
}
public function author()
{
return $this->belongsTo(User::class, 'user_id');
}
}