In Laravel if you wish to update only one record then you can use ->first()
method of Eloquent ORM to get eloquent object and then you can simply update the object by ->save()
.
Laravel query builder directly not supporting update only record as Update with limit of 1 is not directly supported by mysql MySQL - UPDATE query with LIMIT
In the example you have given here is some modification to be work,
DB::table('adminUserLogs')
->where('adminUserId', $id)
->where('adminUserOutTime', NULL)
->update(['adminUserOutTime' => \Carbon\Carbon::now()]);
This will result in updating the records where specified conditions. To update specific record pass id
column in where clause of that particular record.