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
Imagine a conditional loading of a count in an Eloquent query:
if ($bool) $query = $query->withCount('foo');
Then I want to check in blade whether the count is loaded or not, but in the new Eloquent strict mode, all options I tested threw a MissingAttributeException:
I think this should be reconsidered now, either fixing it so that you can check with isset on the existence of attributes, or include a hasAttribute method.
The text was updated successfully, but these errors were encountered:
Description:
Imagine a conditional loading of a count in an Eloquent query:
Then I want to check in blade whether the count is loaded or not, but in the new Eloquent strict mode, all options I tested threw a
MissingAttributeException
:And some years and Laravel versions back there was a decision made against a
hasAttribute
method on theHasAttributes
trait.I think this should be reconsidered now, either fixing it so that you can check with
isset
on the existence of attributes, or include ahasAttribute
method.The text was updated successfully, but these errors were encountered: