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/Question.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 Question extends Model
{
/**
* Fillable attributes for mass assignment.
*/
protected $fillable = [
'question_group_id',
'text',
'has_yes',
'has_no',
'has_na',
'details',
'sort_order',
'is_scored',
];
/**
* Cast attributes to specific types.
*/
protected function casts(): array
{
return [
'question_group_id' => 'integer',
'has_yes' => 'boolean',
'has_no' => 'boolean',
'has_na' => 'boolean',
'sort_order' => 'integer',
'is_scored' => 'boolean',
];
}
/**
* Get the question group that owns this question.
*/
public function questionGroup(): BelongsTo
{
return $this->belongsTo(QuestionGroup::class);
}
}