step 1, 2 and 3 of the implementation plan
This commit is contained in:
39
app/Models/ScreeningAnswer.php
Normal file
39
app/Models/ScreeningAnswer.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
final class ScreeningAnswer extends Model
|
||||
{
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user