Skip to content

Commit

Permalink
use Eloquent getArrayableItems() to return only the attributes that a…
Browse files Browse the repository at this point in the history
…re visible
  • Loading branch information
TheM1984 committed Aug 2, 2023
1 parent d470daf commit 14883f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CastsEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public function setAttribute($key, $value)
*/
public function attributesToArray()
{
return $this->addEnumAttributesToArray(parent::attributesToArray());
return $this->getArrayableItems(
$this->addEnumAttributesToArray(
parent::attributesToArray()
)
);
}

/**
Expand Down

0 comments on commit 14883f9

Please sign in to comment.