Edit seems bugged, so im gonna write the edit here:
Eloquent is referencing parent_user in the sub-query but it isn't using it for the confirmed column. Anyone knows why eloquent is doing this or how I can fix this?
Why?
Probably because of the withPivot inside the childs().
How to fix it?
You could remove the withPivot, and instead of has('child') use
->whereHas('childs', function($shildsQuery){
$childsQuery->where('comfirmed', '=', true);
})->...
You can also try make a scope for the confirmed column. Maybe it will work solve your problem.
Hello,
I have the same problem. Did you find any solution for this?
Thank you!!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community