Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
How to paginate in laravel 8?

I've followed this documnetation (https://laravel.com/docs/8.x/pagination) and made changes accordingly but still I am not able to paginate the required page.

This is my controller code:

public function showManageCourierAddress()
{

    $viewdata = [];
    $addressRepoObj = new \App\Repositories\Mongo\CourierAddressRepository();
    $addressData = $addressRepoObj->getAddressList(0,(int)Session::get('organisation_id'));
    $viewdata['addresslist'] = $addressData;
    unset($addressData);
    
    return view('frontend.admin.managecourieraddress', ['viewdata' => DB::table('viewdata')->paginate(15)]);
}

On the view laravel, I've added this :

{{ $viewdata->links() }}

Can anyone tell me where I'm going wrong? And what I should do?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

DB::table('viewdata')->paginate(15)

returns LengthAwarePaginator instance, which implements these methods.

It is enought to call {{ $viewdata->links() }}, and it should return whole html with pagination buttons and links. You just write some styles for existing classes, or use methods as mentioned above to create your own html with your own structure.

If I did not understand your problem, please reply in comment.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda