Agrego archivos iniciales

This commit is contained in:
Laucha1312
2026-06-04 14:47:50 -03:00
commit ed94601e34
76 changed files with 7737 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?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');
}
}