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

57
app/Models/Screening.php Normal file
View File

@@ -0,0 +1,57 @@
<?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 Screening extends Model
{
/**
* Fillable attributes for mass assignment.
*/
protected $fillable = [
'user_id',
'score',
'passed',
];
/**
* Cast attributes to specific types.
*/
protected function casts(): array
{
return [
'user_id' => 'integer',
'score' => 'integer',
'passed' => 'boolean',
];
}
/**
* Get the user that owns this screening.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Get all answers for this screening.
*/
public function answers(): HasMany
{
return $this->hasMany(ScreeningAnswer::class);
}
/**
* Get all sessions that reference this screening.
*/
public function sessions(): HasMany
{
return $this->hasMany(Session::class);
}
}