Skip to content

Commit e99c609

Browse files
committed
Use Arr::wrap for setting first attribute value
1 parent 3ddf1b4 commit e99c609

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Models/Concerns/HasAttributes.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,9 @@ public function setAttribute($key, $value)
213213
*/
214214
public function setFirstAttribute($key, $value)
215215
{
216-
$current = $this->getAttribute($key);
217-
218216
return $this->setAttribute($key, array_merge(
219-
is_array($current) ? $current : [$current], [$value]
217+
Arr::wrap($this->getAttribute($key)),
218+
Arr::wrap($value)
220219
));
221220
}
222221

0 commit comments

Comments
 (0)