<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Presence extends Model
{
    use HasFactory;

    protected $fillable = [
        'member_id',
        'calendar_id',
        'member_course_id',
        'user_id',
        'motivation_id',
        'motivation_course_id',
        'court_id',
        'instructor_id',
        'notes',
    ];

    public function member()
    {
        return $this->belongsTo(\App\Models\Member::class);
    }

    public function calendar()
    {
        return $this->belongsTo(\App\Models\Calendar::class);
    }

    public function motivation()
    {
        return $this->belongsTo(\App\Models\Motivation::class);
    }

    public function motivationCourse()
    {
        return $this->belongsTo(\App\Models\Course::class, 'motivation_course_id');
    }

    public function user()
    {
        return $this->belongsTo(\App\Models\User::class, 'user_id');
    }

    public function instructor()
    {
        return $this->belongsTo(\App\Models\User::class, 'instructor_id');
    }

    public function court()
    {
        return $this->belongsTo(\App\Models\Court::class);
    }
}
