<?php

namespace App\Models;

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

class MemberCard extends Model
{
    use HasFactory;

    protected $fillable = [
        'member_id',
        'card_id',
        'number',
        'date',
        'accept_date',
        'expire_date',
        'status',
        'discipline1_id',
        'discipline2_id',
        'discipline3_id',
    ];



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

    public function card()
    {
        return $this->belongsTo(Card::class);
    }

    public function discipline_1()
    {
        return $this->belongsTo(Discipline::class, 'discipline1_id', 'id');
    }

    public function discipline_2()
    {
        return $this->belongsTo(Discipline::class, 'discipline2_id', 'id');
    }

    public function discipline_3()
    {
        return $this->belongsTo(Discipline::class, 'discipline3_id', 'id');
    }

}
