id; $vendorContact->purchase_order_invitations()->delete(); PurchaseOrderInvitation::withTrashed()->where('vendor_contact_id', $vendor_contact_id)->cursor()->each(function ($invite){ if($invite->purchase_order()->doesnthave('invitations')) $invite->purchase_order->service()->createInvitations(); }); } /** * Handle the vendor contact "restored" event. * * @param VendorContact $vendorContact * @return void */ public function restored(VendorContact $vendorContact) { } /** * Handle the vendor contact "force deleted" event. * * @param VendorContact $vendorContact * @return void */ public function forceDeleted(VendorContact $vendorContact) { // } }