Can someone explain this odd php exception that happens on toArray and not on eager loading or filters? #53783
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If the resource is retrieved without relations so without eager loading, but just with the appends/accessors the error does not appear.... |
Beta Was this translation helpful? Give feedback.
-
It seems that changing the static::$constraints to false and then to true again, (so the value matches the parent default value), generates the php error. Update Solution is to not use a trait but duplicate code. |
Beta Was this translation helpful? Give feedback.
It seems that changing the static::$constraints to false and then to true again, (so the value matches the parent default value), generates the php error.
Update
local.DEBUG: BEFORE ERROR RelationCleverTrait::$constraints:true
local.DEBUG: BEFORE ERROR Relation::$constraints:false
Solution is to not use a trait but duplicate code.
macropay-solutions/laravel-crud-wizard-free@670949a