How to update multi data into database

Posted 2 months ago by Maung-C

i want to update multi data in my car_trips table, and how to do. follow my code.thanks for your time.

        // dd($car_trips);
        foreach ($request['group_a'] as $car_trip) {
            $carTrip = Car_Trip::where('invcode',$id)->update([
                'check_in' => $car_trip['check_in_show'],
                'check_out' => $car_trip['check_out_show'],
                'trip' => $car_trip['trip'],
                'guest_name' => $car_trip['guest_name'],
                // 'invcode' => $invoicesave,
            ]);
        }

Please sign in or create an account to participate in this conversation.