glorand/laravel-model-settings

Fatal error if I select specific field

snezhkoigor opened this issue · 1 comments

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.

Fix by adding

protected $appends = [...]