Hey, i wanna update my data using array, but its error 'cause im using "like" query while finding the data. This is the code.
$pin = 10590;
$datetime = "2017-08-29 15:05:00";
$date = explode(' ', $datetime);
Attendance::where('user_id', $pin)->where('datetime_in', 'like', '%' . $date[0] . '%')->update([
'datetime_out' => $datetime,
'updated_at' => date('Y-m-d')
]);
any solutions ?? Thanks.
What column type you are using fore datetime_in
? For me the like query is working on timestamp
and datetime
fields.
You don't have to set updated_at
, it will be updated automatically for you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community