diff --git a/app/Models/Component.php b/app/Models/Component.php index a07d052d..af799449 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -107,7 +107,7 @@ class Component extends Model implements HasPresenter ]; /** - * Components can belong to a group. + * Get the group relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -117,7 +117,7 @@ class Component extends Model implements HasPresenter } /** - * Lookup all of the incidents reported on the component. + * Get the incidents relation. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ @@ -127,7 +127,7 @@ class Component extends Model implements HasPresenter } /** - * Components can have many tags. + * Get the tags relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ diff --git a/app/Models/ComponentGroup.php b/app/Models/ComponentGroup.php index b9a3603d..345f2210 100644 --- a/app/Models/ComponentGroup.php +++ b/app/Models/ComponentGroup.php @@ -93,7 +93,7 @@ class ComponentGroup extends Model implements HasPresenter protected $with = ['enabled_components', 'enabled_components_lowest']; /** - * A group can have many components. + * Get the components relation. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Models/Incident.php b/app/Models/Incident.php index 9ea702b5..19fe678f 100644 --- a/app/Models/Incident.php +++ b/app/Models/Incident.php @@ -91,6 +91,16 @@ class Incident extends Model implements HasPresenter 'message', ]; + /** + * Get the component relation. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function component() + { + return $this->belongsTo(Component::class, 'component_id', 'id'); + } + /** * Finds all visible incidents. * @@ -131,16 +141,6 @@ class Incident extends Model implements HasPresenter }); } - /** - * An incident belongs to a component. - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function component() - { - return $this->belongsTo(Component::class, 'component_id', 'id'); - } - /** * Returns whether the "incident" is scheduled or not. * diff --git a/app/Models/Metric.php b/app/Models/Metric.php index 3ef826f3..db594c35 100644 --- a/app/Models/Metric.php +++ b/app/Models/Metric.php @@ -117,7 +117,7 @@ class Metric extends Model implements HasPresenter ]; /** - * Metrics contain many metric points. + * Get the points relation. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Models/MetricPoint.php b/app/Models/MetricPoint.php index fadaae07..2fbd0248 100644 --- a/app/Models/MetricPoint.php +++ b/app/Models/MetricPoint.php @@ -63,7 +63,7 @@ class MetricPoint extends Model implements HasPresenter ]; /** - * A metric point belongs to a metric unit. + * Get the metric relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ diff --git a/app/Models/Subscriber.php b/app/Models/Subscriber.php index f5789e3d..e2f3fe4b 100644 --- a/app/Models/Subscriber.php +++ b/app/Models/Subscriber.php @@ -71,7 +71,7 @@ class Subscriber extends Model implements HasPresenter } /** - * A subscriber has many subscriptions. + * Get the subscriptions relation. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 3a1396c7..fb7872a3 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -50,7 +50,7 @@ class Subscription extends Model ]; /** - * A subscription belongs to a subscriber. + * Get the subscriber relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ @@ -60,7 +60,7 @@ class Subscription extends Model } /** - * A subscription has one component. + * Get the component relation. * * @return \Illuminate\Database\Eloquent\Relations\HasOne */ diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 9e64f096..3c85dfc3 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -45,7 +45,7 @@ class Tag extends Model } /** - * Tags can have many components. + * Get the components relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */