Download the PHP package savannabits/laravel-pagetables without Composer
On this page you can find all versions of the php package savannabits/laravel-pagetables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download savannabits/laravel-pagetables
More information about savannabits/laravel-pagetables
Files in savannabits/laravel-pagetables
Package laravel-pagetables
Short Description Laravel Pagetables is a Server Side Adapter for Datatables using the default Laravel Pagination.
License MIT
Homepage https://github.com/savannabits/laravel-pagetables
Informations about the package laravel-pagetables
Datables Using Laravel's Pagination format
Generate Laravel pagination with support to search, sort, per_page and page queries. The Datatables support searching and ordering by children/parent relationships e.g user.role.name.
If you are on Vue.js, we recommend using the Pagetables Component which renders nice datatables styled in tailwindcss and supports the payload from this package out of the box.
Installation
You can install the package via composer:
Usage
Under the hood, this package uses laravel pagination and returns a LengthAwarePaginator object together with the columns specified. The package has a Column class which helps to construct columns with names and other properties for the sake of frontend rendering and formatting. Use the package in three simple steps:
- Specify the columns as Savannabits\Pagetables\Column[] array.
- Create the datatables from a query, passing in the columns array from step 1.
- Query the controller method from the frontend with parameters such as
search
,sort
,per_page
,sort_direction
andpage
Example In the Controller:
API Request from your client:
Response JSON:
From here, how you use the payload to render the datatable is entirely up to you.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Sam Arossi Maosa
- All Contributors
License
The MIT License (MIT). Please see License File for more information.