generated from liutk/owl-admin-base
35 lines
748 B
PHP
35 lines
748 B
PHP
<?php
|
|
|
|
namespace App\Models\Train;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Traits\HasDateTimeFormatter;
|
|
use EloquentFilter\Filterable;
|
|
|
|
/**
|
|
* 培训管理-课件
|
|
*/
|
|
class Book extends Model
|
|
{
|
|
use HasDateTimeFormatter, Filterable;
|
|
|
|
protected $table = 'train_books';
|
|
|
|
protected $fillable = ['category_id', 'title', 'cover_image', 'description', 'type', 'content', 'video', 'files'];
|
|
|
|
protected $casts = [
|
|
'type' => \App\Enums\BookType::class,
|
|
'files' => 'json',
|
|
];
|
|
|
|
public function modelFilter()
|
|
{
|
|
return \App\Admin\Filters\TrianBookFilter::class;
|
|
}
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(\App\Models\Keyword::class, 'category_id', 'key');
|
|
}
|
|
}
|