Add tag names array to components api. Closes #1697
This commit is contained in:
@@ -46,6 +46,16 @@ class ComponentPresenter extends BasePresenter implements Arrayable
|
||||
return trans('cachet.components.status.'.$this->wrappedObject->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all tag names for the component names.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
return $this->wrappedObject->tags->lists('name', 'slug');
|
||||
}
|
||||
|
||||
/**
|
||||
* Present formatted date time.
|
||||
*
|
||||
@@ -67,6 +77,7 @@ class ComponentPresenter extends BasePresenter implements Arrayable
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
'status_name' => $this->human_status(),
|
||||
'tags' => $this->tags(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user