- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
33 lines
572 B
PHP
33 lines
572 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CustomPostType extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'singular_name',
|
|
'slug',
|
|
'icon',
|
|
'show_in_menu',
|
|
'has_archive',
|
|
];
|
|
|
|
protected $casts = [
|
|
'show_in_menu' => 'boolean',
|
|
'has_archive' => 'boolean',
|
|
];
|
|
|
|
public function fields()
|
|
{
|
|
return $this->hasMany(CustomField::class)->orderBy('sort_order');
|
|
}
|
|
|
|
public function posts()
|
|
{
|
|
return $this->hasMany(Post::class);
|
|
}
|
|
}
|