First Commit
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user