File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ protected function addUpdatedAtColumn(array $values)
309309 }
310310
311311 $ column = $ this ->model ->getUpdatedAtColumn ();
312- $ values = array_merge (
312+ $ values = array_replace (
313313 [$ column => $ this ->model ->freshTimestampString ()],
314314 $ values ,
315315 );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace MongoDB \Laravel \Tests \Ticket ;
6+
7+ use MongoDB \Laravel \Tests \Models \Location ;
8+ use MongoDB \Laravel \Tests \TestCase ;
9+
10+ /** @see https://github.com/mongodb/laravel-mongodb/discussions/3335 */
11+ class GH3335Test extends TestCase
12+ {
13+ public function tearDown (): void
14+ {
15+ Location::truncate ();
16+
17+ parent ::tearDown ();
18+ }
19+
20+ public function testNumericalFieldName ()
21+ {
22+ $ model = new Location ();
23+ $ model ->id = 'foo ' ;
24+ $ model ->save ();
25+
26+ $ model = Location::find ('foo ' );
27+ $ model ->{'38 ' } = 'PHP ' ;
28+ $ model ->save ();
29+
30+ $ model = Location::find ('foo ' );
31+ self ::assertSame ('PHP ' , $ model ->{'38 ' });
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments