33 lines
589 B
PHP
33 lines
589 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Blog extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'post',
|
|
'slug',
|
|
'content',
|
|
'meta',
|
|
'custom_header',
|
|
'post_image',
|
|
'is_published',
|
|
'category_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'meta' => 'json'
|
|
];
|
|
|
|
public function category(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Category::class);
|
|
}
|
|
}
|