src/Eloquent/Concerns/SerializesModels.php
protected function getModelAttributes(Model $model)
    {
        $attributes = [];

        foreach ($this->attributeKeys($model) as $modelKey => $field) {
            if (is_numeric($modelKey)) {
                $modelKey = $field;
                $field = $this->fieldForAttribute($field);
            }

            $attributes[$field] = $this->extractAttribute($model, $modelKey, $field);
        }

        return $attributes;
    }
protected function getModelAttributes(Model $model)
    {
        $attributes = [];

        foreach ($this->attributeKeys($model) as $modelKey => $field) {
            if (is_numeric($modelKey)) {
                $modelKey = $field;
                $field = $this->fieldForAttribute($field);
            }

            $attributes[$field] = $this->extractAttribute($model, $modelKey, $field);
        }

        return $attributes;
    }
Get attributes for the provided model.

@param Model $model
@return array