diff --git a/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php index bfb67754beff..b7e0d7dea8c0 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php @@ -63,7 +63,7 @@ public function fillable(array $fillable) */ public function mergeFillable(array $fillable) { - $this->fillable = array_merge($this->fillable, $fillable); + $this->fillable = array_values(array_unique(array_merge($this->fillable, $fillable))); return $this; } @@ -101,7 +101,7 @@ public function guard(array $guarded) */ public function mergeGuarded(array $guarded) { - $this->guarded = array_merge($this->guarded, $guarded); + $this->guarded = array_values(array_unique(array_merge($this->guarded, $guarded))); return $this; }