Comence con las vistas. El modelo de agenda está practicamente terminado
This commit is contained in:
@@ -20,6 +20,11 @@ class Turno extends Model
|
||||
'agenda_id',
|
||||
'profesional_id',
|
||||
'servicio_id',
|
||||
'modalidad_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'inicio' => 'datetime',
|
||||
];
|
||||
|
||||
public function estadoTurno()
|
||||
@@ -45,4 +50,45 @@ class Turno extends Model
|
||||
{
|
||||
return $this->belongsTo(Servicio::class, 'servicio_id', 'id');
|
||||
}
|
||||
|
||||
public function modalidad()
|
||||
{
|
||||
return $this->belongsTo(Modalidad::class, 'modalidad_id', 'id');
|
||||
}
|
||||
|
||||
public function confirmar()
|
||||
{
|
||||
$this->estadoturno_id = 1; // ID del estado Confirmado (dato maestro)
|
||||
$this->save();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cancelar()
|
||||
{
|
||||
$this->estadoturno_id = 2; // ID del estado Cancelado (dato maestro)
|
||||
$this->save();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reprogramar()
|
||||
{
|
||||
$this->estadoturno_id = 3; // ID del estado Reprogramado (dato maestro)
|
||||
$this->save();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function clienteAusente()
|
||||
{
|
||||
$this->estadoturno_id = 4; // ID del estado Cliente Ausente (dato maestro)
|
||||
$this->save();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function clientePresente()
|
||||
{
|
||||
$this->estadoturno_id = 5; // ID del estado Cliente Presente (dato maestro)
|
||||
$this->save();
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user