Add meta relation to all models

This commit is contained in:
James Brooks
2017-06-13 19:25:43 +01:00
parent 1faee910f3
commit 507ae3e4ed
5 changed files with 64 additions and 11 deletions
+10
View File
@@ -165,6 +165,16 @@ class Metric extends Model implements HasPresenter
});
}
/**
* Get all of the meta relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function meta()
{
return $this->morphMany(Meta::class, 'meta');
}
/**
* Get the points relation.
*