From 44ecf738f73b5452461a2e6b340fd21d8a9f6b00 Mon Sep 17 00:00:00 2001 From: Thai Nguyen Hung Date: Thu, 22 Jun 2023 05:57:51 +0700 Subject: [PATCH] should reindex appends attributes after unique them (#47519) --- src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index 2b392563fe23..4ef0f5314062 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -2125,9 +2125,9 @@ protected function transformModelValue($key, $value) */ public function append($attributes) { - $this->appends = array_unique( + $this->appends = array_values(array_unique( array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes) - ); + )); return $this; }