Let's say I have 2 collections which both have a phone
attribute:
$contacts = Contact::all();
$optouts = Optout::all();
I want to update the $contacts
collection and remove all which are opted out. So I want to remove all $contacts
whose phone
is present in $optouts
.
How do I do it?