📅  最后修改于: 2022-03-11 14:53:55.785000             🧑  作者: Mango
class Instrument extends Model
{
protected $appends = ['benchmark'];
public function getBenchmarkAttribute()
{
// this is equivalent to Instrument::find($this->benchmark_id)
return self::find($this->benchmark_id);
}
}