File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -465,10 +465,17 @@ public function testCustomId()
465
465
$ item = DB ::table ('items ' )->where ('id ' , 'fork ' )->first ();
466
466
$ this ->assertEquals ('fork ' , $ item ->id );
467
467
468
+ $ item = DB ::table ('items ' )->where ('_id ' , 'fork ' )->first ();
469
+ $ this ->assertEquals ('fork ' , $ item ->id );
470
+
468
471
// tags.id is translated into tags._id in query
469
472
$ items = DB ::table ('items ' )->whereIn ('tags.id ' , ['sharp ' ])->get ();
470
473
$ this ->assertCount (2 , $ items );
471
474
475
+ // Ensure the field _id is stored in the database
476
+ $ items = DB ::table ('items ' )->whereIn ('tags._id ' , ['sharp ' ])->get ();
477
+ $ this ->assertCount (2 , $ items );
478
+
472
479
DB ::table ('users ' )->insert ([
473
480
['id ' => 1 , 'name ' => 'Jane Doe ' ],
474
481
['id ' => 2 , 'name ' => 'John Doe ' ],
You can’t perform that action at this time.
0 commit comments