Include default_view_name in metric results

This commit is contained in:
James Brooks
2016-04-22 15:50:14 +01:00
parent 36d89a9ad8
commit 9a743ab425

View File

@@ -34,6 +34,16 @@ class MetricPresenter extends BasePresenter implements Arrayable
}
}
/**
* Determines the metric view filter name, used in the API.
*
* @return string
*/
public function default_view_name()
{
return trans('cachet.metrics.filter.'.$this->trans_string_name());
}
/**
* Determines the metric translation view filter name.
*
@@ -57,8 +67,9 @@ class MetricPresenter extends BasePresenter implements Arrayable
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'default_view_name' => $this->default_view_name(),
]);
}
}