2024-07-15 06:24:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Response extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
2024-07-24 19:41:19 +00:00
|
|
|
protected $fillable = ['form_id', 'user_id', 'response_id', 'question_id', 'answers', 'submitted_at', 'form_snapshot'];
|
2024-07-15 06:24:05 +00:00
|
|
|
|
|
|
|
// Define relationships
|
|
|
|
public function form()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Form::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function question()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Question::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
}
|