segundo commit

This commit is contained in:
Alejandro Tasistro 2021-07-14 22:33:14 -03:00
parent 4a4ede77f0
commit 020c85fe7d
3 changed files with 23 additions and 0 deletions

View File

@ -8,4 +8,12 @@ use Illuminate\Database\Eloquent\Model;
class Dia extends Model
{
use HasFactory;
public function evento() {
return $this->belongsTo(Evento::class);
}
public function horaFlags() {
return $this->hasMany(HoraFlag::class);
}
}

View File

@ -8,4 +8,15 @@ use Illuminate\Database\Eloquent\Model;
class Evento extends Model
{
use HasFactory;
public function dias() {
return $this->hasMany(Dia::class);
}
public function coordinar() {
foreach ($this->dias() as $dia) {
//guardar (nombre, horario, cantidad)
}
}
}

View File

@ -8,4 +8,8 @@ use Illuminate\Database\Eloquent\Model;
class HoraFlag extends Model
{
use HasFactory;
public function dia() {
return $this->belongsTo(Dia::class);
}
}