//ads:
?>
Laravel Pagination links() not working
PHP Snippet 1:
{{ $activities->links('pagination::bootstrap-4') }}
PHP Snippet 2:
php artisan vendor:publish --tag=laravel-pagination
PHP Snippet 3:
@if ($paginator->hasPages())
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}" rel="prev">Previous</a>
@endif
<ul class="pagination-list">
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li><span class="pagination-ellipsis">{{ $element }}</span></li>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li><span class="pagination-link is-current">{{ $page }}</span></li>
@else
<li><a href="{{ $url }}" class="pagination-link">{{ $page }}</a></li>
@endif
@endforeach
@endif
@endforeach
</ul>
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next page</a>
@else
<a class="pagination-next" disabled>Next page</a>
@endif
@endif
PHP Snippet 4:
{{ $activities->links('vendor.pagination.bulma') }}
PHP Snippet 5:
php artisan vendor:publish --tag=laravel-pagination
PHP Snippet 6:
@if ($paginator->hasPages())
PHP Snippet 7:
@if ($paginator->count > 0)
PHP Snippet 8:
{!! $activities->render() !!}
PHP Snippet 9:
{{$activities->render()}}
PHP Snippet 10:
$items = $user_1->all();
// Store records in an array
$records = [];
$i = 0;
foreach($items as $item)
{
$records[$i][0] = $item->user_name;
$records[$i][1] = $item->rech_mobile;
$i++;
}
/****above code was replaced by the following code***/
$items = $user_1->all()->toArray();
/***---toArray() function used to convert object to array***/
PHP Snippet 11:
controller: $users = DB::table('users')->Paginate(10);
view file : {{$users->links('vendor.pagination.default')}}
PHP Snippet 12:
php artisan vendor:publish --tag=laravel-pagination
PHP Snippet 13:
use Illuminate\Pagination\Paginator;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Paginator::useBootstrap();
}