step 1, 2 and 3 of the implementation plan

This commit is contained in:
2026-02-03 09:43:23 +01:00
parent d38001e3e2
commit 3684d9ef6b
34 changed files with 4070 additions and 18 deletions

48
app/Models/Answer.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
final class Answer extends Model
{
/**
* Fillable attributes for mass assignment.
*/
protected $fillable = [
'session_id',
'question_id',
'value',
'text_value',
];
/**
* Cast attributes to specific types.
*/
protected function casts(): array
{
return [
'session_id' => 'integer',
'question_id' => 'integer',
];
}
/**
* Get the session that owns this answer.
*/
public function session(): BelongsTo
{
return $this->belongsTo(Session::class);
}
/**
* Get the question that this answer belongs to.
*/
public function question(): BelongsTo
{
return $this->belongsTo(Question::class);
}
}