Download the PHP package langleyfoxall/react-dynamic-data-table-laravel-api without Composer
On this page you can find all versions of the php package langleyfoxall/react-dynamic-data-table-laravel-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download langleyfoxall/react-dynamic-data-table-laravel-api
More information about langleyfoxall/react-dynamic-data-table-laravel-api
Files in langleyfoxall/react-dynamic-data-table-laravel-api
Package react-dynamic-data-table-laravel-api
Short Description Provides a Laravel API endpoint responder for the `react-dynamic-data-table` component.
License LGPL-3.0-only
Informations about the package react-dynamic-data-table-laravel-api
Laravel API for React Dynamic Data Table
This package provides a Laravel API endpoint responder for the React Dynamic Data Table component.
Installation
Usage
First, create a new route in your API routes file for the data table response, and point it to a controller.
In this controller method, create a new DataTableResponder
passing it the model you wish to return data about, and the provided instance of the Request
object. You can optionally specify changes to the query (such as sorting, or filtering) using the query
method. If you want to alter the data before it gets returned in some way, such as changing attribute values or appending custom attributes, you can take advantage of collectionManipulator
. You can also change number of records shown per page with the setPerPage
method.
See the example usage below.
In your frontend code, you can now use the React Dynamic Data Table package's AjaxDynamicDataTable
component to display a table of this data. The API route previously defined should be passed to this component as the apiUrl
prop.
An example usage is shown below.
Without a model
Sometimes you need to create a table of data for which there is no model (and the data is some kind of aggregation, so a model would not be appropriate).
All versions of react-dynamic-data-table-laravel-api with dependencies
laravel/framework Version ^5.1||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0
langleyfoxall/helpers-laravel Version ^2.0 || ^3.0