How to check if one record is attached to another with same pivot value code example
Example: laravel belongstomany prevent duplicates attach
$cart->items()->syncWithoutDetaching([$item->id]);
$cart->items()->syncWithoutDetaching([$item->id]);