Skip to content

Commit

Permalink
Fix Eloquent UPDATE queries with alias
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed May 24, 2019
1 parent 421138e commit 41b4829
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,11 @@ protected function addUpdatedAtColumn(array $values)
$values
);

$values[$this->qualifyColumn($column)] = $values[$column];
$segments = preg_split('/\s+as\s+/i', $this->query->from);

$qualifiedColumn = end($segments).'.'.$column;

$values[$qualifiedColumn] = $values[$column];

unset($values[$column]);

Expand Down

0 comments on commit 41b4829

Please sign in to comment.