Forms_Laravel/app/Models/Response.php

29 lines
597 B
PHP
Raw Permalink Normal View History

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;
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);
}
}