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

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class QuestionGroup extends Model
{
/**
* Fillable attributes for mass assignment.
*/
protected $fillable = [
'category_id',
'name',
'sort_order',
'description',
'scoring_instructions',
];
/**
* Cast attributes to specific types.
*/
protected function casts(): array
{
return [
'category_id' => 'integer',
'sort_order' => 'integer',
];
}
/**
* Get the category that owns this question group.
*/
public function category(): BelongsTo
{
return $this->belongsTo(Category::class);
}
/**
* Get all questions for this question group.
*/
public function questions(): HasMany
{
return $this->hasMany(Question::class);
}
}