protected function mutateAttributeForArray($key, $value) { $value = $this->mutateAttribute($key, $value); return $value instanceof Arrayable ? $value->toArray() : $value; }