Ahora si(?

This commit is contained in:
Laucha1312
2026-06-04 15:01:53 -03:00
parent 47408d49fc
commit 8fc619f9e7
127 changed files with 12952 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Torneo extends Model
{
use SoftDeletes;
protected $table = 'torneos';
protected $fillable = [
'nombre',
'fecha_inicio',
'fecha_fin',
];
protected $casts = [
'fecha_inicio' => 'datetime',
'fecha_fin' => 'datetime',
];
public function equipos()
{
return $this->belongsToMany(Equipo::class, 'torneo_equipo', 'id_torneo', 'id_equipo')->withPivot('grupo');
}
public function eventos()
{
return $this->hasMany(Evento::class, 'id_torneo');
}
}