Move meta relation into trait

This commit is contained in:
James Brooks
2019-02-18 21:56:25 +00:00
parent 827822e22e
commit 88571d7e8f
6 changed files with 60 additions and 55 deletions
+7 -11
View File
@@ -12,6 +12,7 @@
namespace CachetHQ\Cachet\Models;
use AltThree\Validator\ValidatingTrait;
use CachetHQ\Cachet\Models\Traits\HasMeta;
use CachetHQ\Cachet\Models\Traits\HasTags;
use CachetHQ\Cachet\Models\Traits\SearchableTrait;
use CachetHQ\Cachet\Models\Traits\SortableTrait;
@@ -30,7 +31,12 @@ use McCool\LaravelAutoPresenter\HasPresenter;
*/
class Incident extends Model implements HasPresenter
{
use HasTags, SearchableTrait, SoftDeletes, SortableTrait, ValidatingTrait;
use HasMeta,
HasTags,
SearchableTrait,
SoftDeletes,
SortableTrait,
ValidatingTrait;
/**
* Status for incident being investigated.
@@ -181,16 +187,6 @@ class Incident extends Model implements HasPresenter
return $this->belongsTo(Component::class, 'component_id', 'id');
}
/**
* Get all of the meta relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function meta()
{
return $this->morphMany(Meta::class, 'meta');
}
/**
* Get the updates relation.
*