W @foreach($salidas as $key => $salida) @foreach(\App\Models\Empresa::where("id", $salida->id_empresa)->get() as $empresa) @if($salida->estado == 1) {{ strtoupper($empresa->name) }} @else {{ strtoupper($empresa->name) }} @endif @endforeach @foreach(\App\Models\Destino::where("id", $salida->id_destino)->get() as $destino) @if($salida->estado == 1) @php $dateNew = strtotime($salida->hora); echo date('H:i', $dateNew); @endphp @else @php $dateNew = strtotime($salida->hora); echo date('H:i', $dateNew); @endphp @endif @endforeach @foreach(\App\Models\Destino::where("id", $salida->id_destino)->get() as $destino) @if($salida->estado == 1) {{ $destino->name }} @else {{ $destino->name }} @endif @endforeach @foreach(\App\Models\Puerta::where("id", $salida->id_puerta)->get() as $puerta) @if($salida->estado == 1) {{ $puerta->name }} / @else {{ $puerta->name }} / @endif @endforeach @foreach(\App\Models\Carril::where("id", $salida->id_carril)->get() as $carril) @if($salida->estado == 1) {{ $carril->name }} @else {{ $carril->name }} @endif @endforeach @php if($salida->estado == 1) echo "ABORDAJE"; if($salida->estado == 2) echo "LA PAZ"; if($salida->estado == 3) echo "---"; if($salida->estado == 0) echo "SALIO"; @endphp @endforeach