diff --git a/app/Models/Alert.php b/app/Models/Alert.php index 2c2c7e4db9..c29f7a2aca 100644 --- a/app/Models/Alert.php +++ b/app/Models/Alert.php @@ -63,7 +63,7 @@ class Alert extends Model public function rule() { - return $this->belongsTo('App\Models\Rule', 'rule_id', 'id'); + return $this->belongsTo('App\Models\AlertRule', 'rule_id', 'id'); } public function users() diff --git a/app/Models/AlertRule.php b/app/Models/AlertRule.php index e3c790a60e..ec9a55dfa9 100644 --- a/app/Models/AlertRule.php +++ b/app/Models/AlertRule.php @@ -85,6 +85,6 @@ class AlertRule extends BaseModel public function devices() { - return $this->belongsToMany('App\Models\Device', 'alert_device_map', 'device_id', 'device_id', 'devices'); + return $this->belongsToMany('App\Models\Device', 'alert_device_map', 'device_id', 'device_id'); } } diff --git a/app/Models/Device.php b/app/Models/Device.php index 40aa7c2a92..e433a8aa63 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -594,7 +594,7 @@ class Device extends BaseModel public function syslogs() { - return $this->hasMany('App\Models\General\Syslog', 'device_id', 'device_id'); + return $this->hasMany('App\Models\Syslog', 'device_id', 'device_id'); } public function users()