File tree 3 files changed +3
-11
lines changed
src/Illuminate/Database/Eloquent
tests/Integration/Database
3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ public function isFillable($key)
152
152
}
153
153
154
154
return empty ($ this ->getFillable ()) &&
155
+ strpos ($ key , '. ' ) === false &&
155
156
! Str::startsWith ($ key , '_ ' );
156
157
}
157
158
Original file line number Diff line number Diff line change @@ -376,15 +376,6 @@ public function qualifyColumn($column)
376
376
*/
377
377
protected function removeTableFromKey ($ key )
378
378
{
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
-
388
379
return $ key ;
389
380
}
390
381
Original file line number Diff line number Diff line change @@ -49,11 +49,11 @@ public function testCantUpdateGuardedAttributeUsingJson()
49
49
50
50
public function testCantMassFillAttributesWithTableNamesWhenUsingGuarded ()
51
51
{
52
- $ this ->expectException (\LogicException::class);
53
-
54
52
$ model = new TestModel2 ;
55
53
56
54
$ model ->fill (['foo.bar ' => 123 ]);
55
+
56
+ $ this ->assertCount (0 , $ model ->getAttributes ());
57
57
}
58
58
59
59
public function testUserCanUpdateNullableDate ()
You can’t perform that action at this time.
0 commit comments