Closed simonworkhouse closed 4 years ago
Sorry, this probably should have been a draft pull request as there is probably some discussion to be had whether or not we can ignore considerations for changes in casts or potential mutators.
@Omranic Any chance that this will be looked at?
@Omranic, will be looked at?
Merged, thank you! Further performance improvements, and / or test suites will be appreciated :)
When accessing Eloquent model attributes via
$model->getAttribute(...)
or$model->attribute
, Eloquent will check if the attribute needs to be cast or mutated. This adds significant processing time when accessing attributes so instead we bypass this by calling$model->getAttributes()['attribute']
and casting it ourselves.