diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index 670f7409f073..051b5aa2d0e4 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -71,7 +71,7 @@ class Builder * @var array */ protected $passthru = [ - 'insert', 'insertGetId', 'getBindings', 'toSql', 'dump', 'dd', + 'insert', 'insertOrIgnore', 'insertGetId', 'insertUsing', 'getBindings', 'toSql', 'dump', 'dd', 'exists', 'doesntExist', 'count', 'min', 'max', 'avg', 'average', 'sum', 'getConnection', ]; diff --git a/tests/Database/DatabaseEloquentBuilderTest.php b/tests/Database/DatabaseEloquentBuilderTest.php index 34f3337a334b..f80d4407aa6a 100755 --- a/tests/Database/DatabaseEloquentBuilderTest.php +++ b/tests/Database/DatabaseEloquentBuilderTest.php @@ -607,6 +607,21 @@ public function testQueryPassThru() $builder->getQuery()->shouldReceive('insert')->once()->with(['bar'])->andReturn('foo'); $this->assertEquals('foo', $builder->insert(['bar'])); + + $builder = $this->getBuilder(); + $builder->getQuery()->shouldReceive('insertOrIgnore')->once()->with(['bar'])->andReturn('foo'); + + $this->assertEquals('foo', $builder->insertOrIgnore(['bar'])); + + $builder = $this->getBuilder(); + $builder->getQuery()->shouldReceive('insertGetId')->once()->with(['bar'])->andReturn('foo'); + + $this->assertEquals('foo', $builder->insertGetId(['bar'])); + + $builder = $this->getBuilder(); + $builder->getQuery()->shouldReceive('insertUsing')->once()->with(['bar'], 'baz')->andReturn('foo'); + + $this->assertEquals('foo', $builder->insertUsing(['bar'], 'baz')); } public function testQueryScopes()