37 lines
700 B
PHP
37 lines
700 B
PHP
<?php
|
|
|
|
namespace Paymenter\Extensions\Others\KnowledgeBase\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Article extends Model
|
|
{
|
|
protected $table = 'ext_kb_articles';
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'content',
|
|
'description',
|
|
'published_at',
|
|
'is_active',
|
|
'slug',
|
|
'category_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'published_at' => 'datetime',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function category(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Category::class);
|
|
}
|
|
|
|
public function getRouteKeyName()
|
|
{
|
|
return 'slug';
|
|
}
|
|
}
|