You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry no PR, my example describes my exact use case. I'm assuming this is because the withDistance method returning an attribute not on my model, which is what Laravel's built in strict mode prevents.
Changing my coilumn name to "distance" or adding a third argument to withDistance may be worth a try i.e.
As far as I know, the error is thrown only when the data is not in the $model->attributes array. In this case, it should be, because it was returned from the database. Maybe you load the distance attribute conditionally?
Within my app service provider I'm calling:
I'm then calling a query as follows:
In a HTTP resource I'm then accessing
$this->distance
.I then get an exception (
MissingAttributeException
).When I comment out
shouldBeStrict
, everything works fine. Is there any way around this?The text was updated successfully, but these errors were encountered: