<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserDisease extends Model
{
    protected $fillable = ['genetic_disease_id', 'user_id','genetic_disease_variant_id'];

    public function user(){
        return $this->belongsToMany(User::class,'user_diseases','user_id','genetic_disease_id');
    }

    public function geneticDisease(){
        return $this->belongsTo(GeneticDisease::class, 'genetic_disease_id');
    }

    public function geneticDiseaseVariant(){
        return $this->hasMany(UserDiseaseVariant::class, 'genetic_disease_id');
    }
}
