<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\Pivot;

class CourseLessonStudent extends Pivot
{
    protected $table = 'course_lesson_students';

    protected $casts = [
        'completed_at' => 'datetime',
    ];

    public function lesson()
    {
        return $this->belongsTo(CourseLesson::class, 'course_lesson_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
