-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Since MySQL syntax for UPDATE statement is the following
UPDATE [LOW_PRIORITY] [IGNORE] table_reference
SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
method compileUpdate should be extended in Illuminate/Database/Query/Grammars/MySqlGrammar.php
For example:
public function compileUpdate(Builder $query, $values)
{
if ( isset($query->orders) ) {
$orders = ' '.$this->compileOrders($query, $query->orders);
} else {
$orders = '';
}
if ( isset($query->limit) ) {
$limit = ' '.$this->compileLimit($query, $query->limit);
} else {
$limit = '';
}
return parent::compileUpdate($query, $values).$orders.$limit;
}
Metadata
Metadata
Assignees
Labels
No labels