<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class EncounterParticipant extends Model
{
    use HasFactory;

    public $fillable = [
        'encounter_id',
        'type',
        'participantable_type',
        'participantable_id'
    ];


    public function encounter()
    {
        return $this->belongsTo(Encounter::class, 'encounter_id');
    }

    public function participantable()
    {
        return $this->morphTo();
    }
}
