@php use App\Alumno; use App\Pago; use App\PagoTipo; use App\Concepto; use App\TipoPago; $fechaHoy = date("Y-m-d"); //$fechaHoy="2022-02-10"; $pagos = Pago::whereDate('created_at', $fechaHoy) ->with('alumno','tipospago', 'concepto') ->get(); $totalPago = 0; foreach ($pagos as $pago) { foreach ($pago->tipospago as $tipospago) { $totalPago += $tipospago->pago; } } @endphp
Concepto | Cantidad | Alumn@ |
---|---|---|
{{$pago->Concepto->concepto}} | @foreach($pago->tipospago as $tipospago)${{number_format($tipospago->pago,2)}} | @endforeach{{$pago->alumno->nombre}} {{$pago->alumno->apellidos}} |
Total: | ${{ number_format($totalPago, 2) }} |