I have a query:
$undeliveredTransactions = Transaction::whereHas('carts.acceptedcarts', function ($query) {
$query->where('delivered', false);
})->orWhereHas('carts' , function ($query){
$query->where('full_accepted' , false);
})->where('user_id', Auth::id())->get();
The where('user_id' , Auth::id()) is fixed and necessary, but two whereHas one of them is necessary.
How can I implement this?