Move HumanStatus to Presenter, see also #1258

This commit is contained in:
phecho
2015-12-23 21:04:30 +08:00
parent e64f3bf8c3
commit a6f6753fa0
4 changed files with 15 additions and 21 deletions

View File

@@ -22,13 +22,6 @@ class Incident extends Model implements HasPresenter
{
use SoftDeletes, ValidatingTrait;
/**
* The accessors to append to the model's serialized form.
*
* @var string[]
*/
protected $appends = ['human_status'];
/**
* The attributes that should be casted to native types.
*
@@ -118,18 +111,6 @@ class Incident extends Model implements HasPresenter
return $this->belongsTo(Component::class, 'component_id', 'id');
}
/**
* Returns a human readable version of the status.
*
* @return string
*/
public function getHumanStatusAttribute()
{
$statuses = trans('cachet.incidents.status');
return $statuses[$this->status];
}
/**
* Returns whether the "incident" is scheduled or not.
*