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

45
app/Models/Category.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
final class Category extends Model
{
/**
* Fillable attributes for mass assignment.
*/
protected $fillable = [
'name',
'sort_order',
];
/**
* Cast attributes to specific types.
*/
protected function casts(): array
{
return [
'sort_order' => 'integer',
];
}
/**
* Get all question groups for this category.
*/
public function questionGroups(): HasMany
{
return $this->hasMany(QuestionGroup::class);
}
/**
* Get all sessions for this category.
*/
public function sessions(): HasMany
{
return $this->hasMany(Session::class);
}
}