belongsTo('environment', Environment::class); $relations->belongsTo('zone', Zone::class); $relations->belongsTo('state', HostState::class) ->setForeignKey('last_comment_id') ->setCandidateKey('id'); } }