28 lines
610 B
PHP
28 lines
610 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use EloquentFilter\Filterable;
|
|
|
|
class Region extends Model
|
|
{
|
|
use HasFactory;
|
|
use Filterable;
|
|
|
|
protected $fillable = [
|
|
'name', 'cover', 'director', 'area', 'description', 'category_id',
|
|
'sort', 'is_recommend','is_enable'
|
|
];
|
|
|
|
protected function serializeDate(\DateTimeInterface $date){
|
|
return $date->format('Y-m-d H:i:s');
|
|
}
|
|
|
|
public function category(){
|
|
return $this->belongsTo(RegionCategory::class, 'category_id');
|
|
}
|
|
|
|
}
|