/** * Update a record in the database. * * @param array $values * @return int */ public function update(array $values) { $sql = $this->grammar->compileUpdate($this, $values); return $this->connection->update($sql, $this->cleanBindings($this->grammar->prepareBindingsForUpdate($this->bindings, $values))); }
/** * Prepare the bindings for an update statement. * * @param array $bindings * @param array $values * @return array */ public function prepareBindingsForUpdate(array $bindings, array $values) { foreach ($values as $column => $value) { if ($this->isJsonSelector($column) && in_array(gettype($value), ['boolean', 'integer', 'double'])) { unset($values[$column]); } } return parent::prepareBindingsForUpdate($bindings, $values); }