diff --git a/src/Transeloquent.php b/src/Transeloquent.php index 2263239..d56f9c0 100644 --- a/src/Transeloquent.php +++ b/src/Transeloquent.php @@ -22,7 +22,7 @@ trait Transeloquent * @var array */ protected $transeloquent = [ - 'attributes' => [], + 'attributes' => [], 'translations' => [], ]; @@ -53,6 +53,7 @@ public static function bootTranseloquent(): void public function attributesToArray() { $attributes = parent::attributesToArray(); + return array_merge(collect($this->transeloquent['attributes'])->toArray(), $attributes); }