Add meta relation to all models
This commit is contained in:
+14
-1
@@ -145,7 +145,10 @@ class Incident extends Model implements HasPresenter
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $with = ['updates'];
|
||||
protected $with = [
|
||||
'meta',
|
||||
'updates',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the component relation.
|
||||
@@ -157,6 +160,16 @@ 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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user