mardi 5 septembre 2017

how can I do in Laravel a pagination of a table (in view), sending a collect from the controller loaded with data from distant tables of the DB?

This is what I am currently using

--in controller--

  $todo = collect([
  'clientes' => ['id'=>$id, 'nombre_completo'=>$nombre_completo, 'telefono'=>$telefono, 'email'=>$email,],
  'vencimiento' => ['fin' => $vencimiento, 'inicio' => $alta, 'estado'=>$estado],
  'planes' =>$plan,
  'id'=> $nplan
]);

return view('admin.inscripciones', compact('todo'));

--view--

        <tbody>
    @for ($i = 0; $i < $todo['vencimiento']['inicio']->count(); $i++)
    <tr>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td>
          <span class="badge bg-red" ></span>
      </td>
    </tr>
    @endfor
  </tbody>
  </table>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire