get(); // // dd($accessoryCheckouts); $declinedCheckoutAcceptances = CheckoutAcceptance::query() ->where([ 'checkoutable_type' => Accessory::class, ]) // if it was declined and the qty is null that means it potentially left // some entries in the `accessories_checkout` table behind. ->whereNull('qty') ->declined() ->get(); return 0; } }