Add all files
This commit is contained in:
36
extensions/Others/KnowledgeBase/Models/Article.php
Normal file
36
extensions/Others/KnowledgeBase/Models/Article.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user