*/ protected $fillable = [ 'id', 'name', 'description', 'sort', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'id' => 'integer', 'sort' => 'integer', ]; /** * 分类 * @return HasMany */ public function department(): HasMany { return $this->hasMany(Department::class, 'category_id'); } }