Fatal error if I select specific field
snezhkoigor opened this issue · 1 comments
snezhkoigor commented
I have model:
... public $settingsFieldName = 'overridable'; ... public function getContractNameAttribute($value): string { return $this->settings()->get('contract_name') ?? $value; } ...
I get fatal error
Unknown field (overridable) on table
after
query()->select('contract_number')->get()
That’s right because I don’t load overridable field in my model.
snezhkoigor commented
Fix by adding
protected $appends = [...]