Commit eb000d45 authored by Jens Segers's avatar Jens Segers

Pass options from Eloquent builder to Query builder, fixes #558

parent 45f723be
......@@ -20,9 +20,10 @@ class Builder extends EloquentBuilder
* Update a record in the database.
*
* @param array $values
* @param array $options
* @return int
*/
public function update(array $values)
public function update(array $values, array $options = [])
{
// Intercept operations on embedded models and delegate logic
// to the parent relation instance.
......@@ -32,7 +33,7 @@ class Builder extends EloquentBuilder
return 1;
}
return parent::update($values);
return $this->query->update($this->addUpdatedAtColumn($values), $options);
}
/**
......
......@@ -426,6 +426,14 @@ class QueryBuilderTest extends TestCase
);
$this->assertEquals(1, DB::collection('items')->count());
Item::where('name', 'spoon')
->update(
['amount' => 1],
['upsert' => true]
);
$this->assertEquals(2, DB::collection('items')->count());
}
public function testUnset()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment