<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SurveyResponse extends Model {
    protected $guarded=['id'];protected $casts=['answers'=>'array','submitted_at'=>'datetime'];
    public function survey(){return $this->belongsTo(Survey::class);}
    public function respondent(){return $this->morphTo();}
    public function recipient(){return $this->belongsTo(SurveyRecipient::class,'survey_recipient_id');}
}
