diff --git a/Eloquent/Concerns/GuardsAttributes.php b/Eloquent/Concerns/GuardsAttributes.php index 55dc50a51..e89f65d1c 100644 --- a/Eloquent/Concerns/GuardsAttributes.php +++ b/Eloquent/Concerns/GuardsAttributes.php @@ -152,6 +152,7 @@ public function isFillable($key) } return empty($this->getFillable()) && + strpos($key, '.') === false && ! Str::startsWith($key, '_'); } diff --git a/Eloquent/Model.php b/Eloquent/Model.php index 074745ed8..ed163552f 100644 --- a/Eloquent/Model.php +++ b/Eloquent/Model.php @@ -376,15 +376,6 @@ public function qualifyColumn($column) */ protected function removeTableFromKey($key) { - if (strpos($key, '.') !== false) { - if (! empty($this->getGuarded()) && - $this->getGuarded() !== ['*']) { - throw new LogicException('Mass assignment of Eloquent attributes including table names is unsafe when guarding attributes.'); - } - - return last(explode('.', $key)); - } - return $key; }