I should insert an array such as $attendanceList = [18354012,18354013,18354014,18354015]
and $present = "FALSE"
and same for all item of $attendanceList
. As you see $attendanceList
is array but $present
is String
.
When I insert like DB::table("attendance")->insert(["id"=>$attendanceList,"present"=>"FALSE"])
returns error.
What should I do? Pairing all item of $attendanceList
and $present
or there are another ways?
Note: I don't want to use loop if it is possible.