【发布时间】:2018-03-08 21:19:14
【问题描述】:
有没有办法通过 eloquent 在 select/get 上添加事件?
我只看到这些方法:
public function getObservableEvents()
{
return array_merge(
array(
'creating', 'created', 'updating', 'updated',
'deleting', 'deleted', 'saving', 'saved',
'restoring', 'restored',
),
$this->observables
);
}
我希望能够更改模型返回的值
我有这个模型:
class Fee extends Eloquent {
protected $table = 'fees';
protected $fillable = array('occ_paxs_id',
'description',
'amount',
'other',
'hstgst',
'pst',);
}
$fee = Fee::find($id); // here I want to be able to add a markup on the property amount
【问题讨论】:
标签: php laravel laravel-4 eloquent