index.blade.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. @if (!empty($data['parti_coinvolte']))
  2. @php
  3. $vehicles = collect($data['parti_coinvolte'])->filter(function ($item) {
  4. return $item->conducente_o_pedone == 2;
  5. });
  6. @endphp
  7. @if ($vehicles->count() > 0)
  8. <table width="100%" class="table-title">
  9. <tr>
  10. <td align="center">
  11. <h2>VEICOLI COINVOLTI</h2>
  12. </td>
  13. </tr>
  14. </table>
  15. <table class="table-content" width="100%">
  16. <thead>
  17. <tr>
  18. <th width="30%" align="left">VEICOLO</th>
  19. <th width="35%" align="left">TARGA</th>
  20. <th width="35%" align="center">CONDUCENTE</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. @foreach ($vehicles as $veicolo)
  25. <tr>
  26. <td width="30%" align="left">
  27. {{ optional(optional($veicolo->veicolo_data)->marca)->name }}
  28. {{ optional(optional($veicolo->veicolo_data)->modello)->name }}
  29. </td>
  30. <td width="35%" align="left">
  31. {{ optional($veicolo->veicolo_data)->targa }}
  32. </td>
  33. <td width="35%" align="center">
  34. {{ optional($veicolo->anagrafica_data)->lastname }}
  35. {{ optional($veicolo->anagrafica_data)->firstname }}
  36. </td>
  37. </tr>
  38. @endforeach
  39. </tbody>
  40. </table>
  41. @endif
  42. @endif