title: Laravel excel 3.1 add extra rows between iterations
body: <p>I have one to many relationship between two tables one is "alquileres" (rents) and the other is "cobros" (payments). <strong>I need to show the totals of each rental like this:</strong>
  <a href="https://i.stack.imgur.com/VRFvc.png" rel="nofollow noreferrer">what i need</a></p>
  
  <p><strong>But obtain this:</strong>
  <a href="https://i.stack.imgur.com/hSCOI.png" rel="nofollow noreferrer">result</a></p>
  
  <p>This is the code of my export:</p>
  
  <pre><code>class ComprobantesExport implements FromCollection, WithMapping, WithHeadings, ShouldAutoSize, WithEvents
  {
  use Exportable, RegistersEventListeners;
  
  protected $alquileres;
  
  public function __construct($alquileres = null)
  {
      $this-&gt;alquileres = $alquileres;
  }
  /**
   * @return \Illuminate\Support\Collection
   */
  public function collection()
  {
      return $this-&gt;alquileres;
  }
  
  public function headings(): array
  {
      return [
          '#',
          'Fecha',
          'Inquilino',
          'Propiedad',
          'Subpropiedad',
          'Atraso',
          'Monto'
      ];
  }
  
  public function map($alquiler): array
  {
      return $alquiler-&gt;cobros-&gt;map(function ($cobro, $nro) use ($alquiler){
          return [
              $cobro-&gt;comprobante-&gt;id,
              $cobro-&gt;created_at-&gt;format("d/m/Y"),
              $alquiler-&gt;inquilino-&gt;full_name,
              $alquiler-&gt;propiedad-&gt;titulo,
              $alquiler-&gt;subpropiedad-&gt;titulo,
              'si',
              $alquiler-&gt;moneda-&gt;simbolo . $cobro-&gt;comprobante-&gt;monto,
  
          ];
  
      })-&gt;toArray();
  }
  
  
  /**
   * @return array
   */
  public function registerEvents(): array
  {
      return [
          BeforeExport::class =&gt; function(BeforeExport $event) {
              $event-&gt;writer-&gt;getProperties()-&gt;setCreator('Sistema de alquileres');
          },
  
      ];
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My controller:</p>
  
  <pre><code>public function comprobantes()
  {
      $alquileres = Alquiler::with('moneda', 'inquilino', 'propiedad', 'subpropiedad', 'cobros')
          -&gt;get();
  
      return(new ComprobantesExport($alquileres))-&gt;download('comprobantes.xlsx');
  }
  </code></pre>