DEV Community

Cover image for Laravel pagination with parameters on views
Gagang
Gagang

Posted on

1

Laravel pagination with parameters on views

Based on this documentation. https://laravel.com/docs/8.x/pagination#introduction

to make pagination in laravel views along with parameters. I use this script.

@php
$first = 0;
$end = 0;
@endphp
@foreach($datas as $key=> $data)
{{ $key+ $datas->firstItem() }}
@php
$first = $datas->firstItem();
$end = $key + $datas->firstItem();
@endphp
@endforeach
{!! $first !!} - {!! $end !!} From {!! $datas->total() !!} Data
{!! $datas->appends(request()->query())->links() !!}
view raw index.blade.php hosted with ❤ by GitHub

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay