32 lines
595 B
PHP
32 lines
595 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class ExamResult extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'user_id',
|
||
|
|
'exam_id',
|
||
|
|
'is_attempted',
|
||
|
|
'score',
|
||
|
|
'is_passed'
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'is_attempted' => 'boolean',
|
||
|
|
'is_passed' => 'boolean',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function exam(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Exam::class);
|
||
|
|
}
|
||
|
|
}
|