Format meta for incidents as key/value pairs
This commit is contained in:
@@ -279,6 +279,16 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the meta in a key value pair.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function meta()
|
||||
{
|
||||
return $this->wrappedObject->meta->pluck('value', 'key')->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the presenter instance to an array.
|
||||
*
|
||||
@@ -294,6 +304,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
'latest_icon' => $this->latest_icon(),
|
||||
'permalink' => $this->permalink(),
|
||||
'duration' => $this->duration(),
|
||||
'meta' => $this->meta(),
|
||||
'occurred_at' => $this->occurred_at(),
|
||||
'created_at' => $this->created_at(),
|
||||
'updated_at' => $this->updated_at(),
|
||||
|
||||
Reference in New Issue
Block a user