39 lines
852 B
PHP
Executable File
39 lines
852 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TutorialUserProgress extends Model
|
|
{
|
|
protected $fillable = [
|
|
'user_id',
|
|
'completed_lessons',
|
|
'quiz_answers',
|
|
'quiz_score',
|
|
'quiz_passed',
|
|
'quiz_completed_at',
|
|
'certificate_generated_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'completed_lessons' => 'array',
|
|
'quiz_answers' => 'array',
|
|
'quiz_score' => 'integer',
|
|
'quiz_passed' => 'boolean',
|
|
'quiz_completed_at' => 'datetime',
|
|
'certificate_generated_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|