<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Pase extends Model
{
    protected $table = 'pases';
    protected $primaryKey = 'id_pase';

    protected $fillable = [
        'id_jugador',
        'id_club_origen',
        'id_club_destino',
        'estado'
    ];

    public function jugador()
    {
        return $this->belongsTo(Jugador::class, 'id_jugador', 'id_jugador');
    }

    public function clubOrigen()
    {
        return $this->belongsTo(Club::class, 'id_club_origen', 'id_club');
    }

    public function clubDestino()
    {
        return $this->belongsTo(Club::class, 'id_club_destino', 'id_club');
    }
}
