File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/Illuminate/Database/Query Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ public function distinct()
439
439
/**
440
440
* Set the table which the query is targeting.
441
441
*
442
- * @param \Closure|\Illuminate\Database\Query\Builder|string $table
442
+ * @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder| string $table
443
443
* @param string|null $as
444
444
* @return $this
445
445
*/
Original file line number Diff line number Diff line change @@ -5231,6 +5231,18 @@ public function testWhereJsonLengthSqlServer()
5231
5231
$ this ->assertEquals ([1 ], $ builder ->getBindings ());
5232
5232
}
5233
5233
5234
+ public function testFrom ()
5235
+ {
5236
+ $ builder = $ this ->getBuilder ();
5237
+ $ builder ->from ($ this ->getBuilder ()->from ('users ' ), 'u ' );
5238
+ $ this ->assertSame ('select * from (select * from "users") as "u" ' , $ builder ->toSql ());
5239
+
5240
+ $ builder = $ this ->getBuilder ();
5241
+ $ eloquentBuilder = new EloquentBuilder ($ this ->getBuilder ());
5242
+ $ builder ->from ($ eloquentBuilder ->from ('users ' ), 'u ' );
5243
+ $ this ->assertSame ('select * from (select * from "users") as "u" ' , $ builder ->toSql ());
5244
+ }
5245
+
5234
5246
public function testFromSub ()
5235
5247
{
5236
5248
$ builder = $ this ->getBuilder ();
You can’t perform that action at this time.
0 commit comments