Download the PHP package lati111/laravel_dataproviders without Composer
On this page you can find all versions of the php package lati111/laravel_dataproviders. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lati111/laravel_dataproviders
More information about lati111/laravel_dataproviders
Files in lati111/laravel_dataproviders
Package laravel_dataproviders
Short Description A composer package for laravel to create interactable and customizable datatables through api calls
License MIT
Informations about the package laravel_dataproviders
Laravel dataproviders
Adds a base for easy dataprovider manipulation to Laravel. Dataproviders are the API side of a data table, allowing you to search, split by page, sort or filter a model which can then be loaded into a client side table. We recommend user our TypeScript receiver scripts for this, but you can also build your own.
- Laravel dataproviders
- Installation
- Usage
- Paginatable
- Searchable
- Sortable
- Filterable
- Requirements
Installation
Usage
To create a basic dataprovider with no additional functions:
Paginatable
A dataprovider can be made paginatable, meaning the content in seperated into different pages which can be navigated through. To create a paginatable dataprovider, do as follows:
You can pass the page
and perpage
variables along the request. Page indicates which page should be loaded, while perpage sets the amount of entries that should be loaded.
Alternatively, you may use offset
instead of page
if you want to handle pagination manually, such as in the case of a scroll to load item.
Searchable
A dataprovider can be made to be searchable, allowing the user to search the dataprovider for certain values. To make a dataprovider paginatable, you can do the following:
You can pass the search
variable along the request, indicating which term to search for in the selected columns.
Sortable
A dataprovider can be made to be searchable, allowing the user to indicate which columns should be sorted on. To make a dataprovider sortable, you can do the following:
You can pass the a json array of sortables along through the request variables under the key 'sort'. The array should be as follows
Filterable
A dataprovider can be made to be filterable, allowing the user to filter on certain values. To make a dataprovider sortable, you can do the following:
Filters must implement the DataproviderFilterInterface
interface to work, and be constructed as follows:
You can pass the a json array of filters along through the request variables under the key 'sort'. The array should be as follows
Requirements
- PHP ^8.1
- Laravel ^10.0
All versions of laravel_dataproviders with dependencies
illuminate/http Version >=10.0 <12.0
illuminate/database Version >=10.0 <12.0