我已经在模型中创建了一个转换器。
Class Client {
protected $fillable = ['name', 'age']
public function getIndustryAttribute() {
// some evaluations;
return "Programmer"
}
}
现在,我试图Client::where('industry', "Programmer")->get()
用来获取价值。这有可能吗?
请记住,这是一个完全伪的代码,用于说明。由于计划不周,我最终还是这样。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句