File tree Expand file tree Collapse file tree
src/Illuminate/Database/Eloquent
tests/Integration/Database Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ public function isFillable($key)
152152 }
153153
154154 return empty ($ this ->getFillable ()) &&
155+ strpos ($ key , '. ' ) === false &&
155156 ! Str::startsWith ($ key , '_ ' );
156157 }
157158
Original file line number Diff line number Diff line change @@ -376,15 +376,6 @@ public function qualifyColumn($column)
376376 */
377377 protected function removeTableFromKey ($ key )
378378 {
379- if (strpos ($ key , '. ' ) !== false ) {
380- if (! empty ($ this ->getGuarded ()) &&
381- $ this ->getGuarded () !== ['* ' ]) {
382- throw new LogicException ('Mass assignment of Eloquent attributes including table names is unsafe when guarding attributes. ' );
383- }
384-
385- return last (explode ('. ' , $ key ));
386- }
387-
388379 return $ key ;
389380 }
390381
Original file line number Diff line number Diff line change @@ -49,11 +49,11 @@ public function testCantUpdateGuardedAttributeUsingJson()
4949
5050 public function testCantMassFillAttributesWithTableNamesWhenUsingGuarded ()
5151 {
52- $ this ->expectException (\LogicException::class);
53-
5452 $ model = new TestModel2 ;
5553
5654 $ model ->fill (['foo.bar ' => 123 ]);
55+
56+ $ this ->assertCount (0 , $ model ->getAttributes ());
5757 }
5858
5959 public function testUserCanUpdateNullableDate ()
You can’t perform that action at this time.
0 commit comments