*/ protected $fillable = [ 'name', 'description', 'status', ]; /** * 获取关联的终端 * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function terminals() { return $this->belongsToMany(Terminal::class, 'terminal_knowledge_bases') ->withPivot('priority') ->withTimestamps() ->orderBy('priority'); } }