To customize the pagination template in Laravel Nova, you can publish the pagination view using the following command:
php artisan vendor:publish --tag=nova-pagination
This will create a new pagination.blade.php file in the resources/views/vendor/nova directory. You can then modify this file to customize the pagination template.
To move the "per page" select to the bottom of the pagination, you can modify the pagination.blade.php file as follows:
- Find the line that renders the "per page" select dropdown:
<div class="inline-flex items-center ml-3">
<label for="perPage" class="mr-2">{{ __('Per Page') }}:</label>
<select wire:model="perPage" id="perPage" class="form-control form-select">
@foreach($perPageOptions as $option)
<option value="{{ $option }}">{{ $option }}</option>
@endforeach
</select>
</div>
- Cut this code block and paste it after the line that renders the pagination links:
{{ $paginator->links('nova::pagination-links') }}
<div class="inline-flex items-center ml-3">
<label for="perPage" class="mr-2">{{ __('Per Page') }}:</label>
<select wire:model="perPage" id="perPage" class="form-control form-select">
@foreach($perPageOptions as $option)
<option value="{{ $option }}">{{ $option }}</option>
@endforeach
</select>
</div>
This will move the "per page" select to the bottom of the pagination links.
Note: If you're using Laravel Nova 3.x, you may need to modify the nova::pagination view instead of the nova::pagination.blade.php file.