43 lines
833 B
PHP
43 lines
833 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
final class ScreeningAnswer extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* Fillable attributes for mass assignment.
|
|
*/
|
|
protected $fillable = [
|
|
'screening_id',
|
|
'question_number',
|
|
'value',
|
|
];
|
|
|
|
/**
|
|
* Cast attributes to specific types.
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'screening_id' => 'integer',
|
|
'question_number' => 'integer',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the screening that owns this answer.
|
|
*/
|
|
public function screening(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Screening::class);
|
|
}
|
|
}
|