add(new Binary([ 'id', 'host_id', 'hostgroup_id', 'environment_id' ])); } public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); $relations->belongsTo('hostgroup', Hostgroup::class); $relations->belongsTo('host', Host::class); $relations->hasMany('service', Service::class) ->setForeignKey('host_id') ->setCandidateKey('host_id'); } }