This commit is contained in:
Laucha1312
2026-06-04 15:00:21 -03:00
parent ed94601e34
commit 47408d49fc
76 changed files with 0 additions and 7737 deletions
-41
View File
@@ -1,41 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Equipo extends Model
{
use SoftDeletes;
protected $table = 'equipos';
protected $primaryKey = 'id_equipo';
public $timestamps = true;
protected $fillable = [
'id_club',
'categoria',
'division',
];
protected $casts = [
'id_equipo' => 'integer',
'id_club' => 'integer',
];
public function club()
{
return $this->belongsTo(Club::class, 'id_club', 'id_club');
}
public function jugadores()
{
return $this->belongsToMany(Jugador::class, 'jugador_equipo', 'id_equipo', 'id_jugador')
->withPivot('fecha_alta');
}
public function torneos()
{
return $this->belongsToMany(Torneo::class, 'torneo_equipo', 'id_equipo', 'id_torneo');
}
}