platform
platform copied to clipboard
BugFix Trait AsSource
The trait is part of the model class, so can access also to private and protected members. For example if we use this trait on a model with a nullable database field called "visible"
Arr::get($this->toArray(), $field) ---> is null Arr::get($this->getRelations(), $field) ---> is null $this->$field ---> refear to "protected $visible = []"
with this commit the problem is solved, and anso bring a performance improvement: ->toArray() force the execution of all casts and accessors, but only one filed is requested.