Download the PHP package develme/restful-lists without Composer
On this page you can find all versions of the php package develme/restful-lists. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download develme/restful-lists
More information about develme/restful-lists
Files in develme/restful-lists
Package restful-lists
Short Description Adds filter, order, and pagination to your restful resource lists
License MIT
Informations about the package restful-lists
Restful Lists is a library that allows a list style endpoint to instantly support common features like filtering, sorting, and pagination. Wrap your data in an engine or service class to quickly parse get/post variables detailing what filters, orders, and pagination to apply.
Install
Data Types
Data types are the different forms of persistent data the engine attempts to filter, order and paginate. This is the layer one can use to add support for various data layers like Redis, SQL, Plain Arrays, even data stored in files or other API endpoints.
Supported
- Collection
- Eloquent's Model Builder
Coming Soon
- Array
- Eloquent's Query Builder
Examples
Using the service within a laravel/lumen controller
This example uses the service class. The service class automatically parses get and post vars to apply filtering, sorting and pagination. You can find example javascript and url structures below.
Using the engine directly
Example javascript object structure
Example URL created from the javascript object
Example PHP array structure as a result of the javascript passed back
Customization
Data Types
Custom Data Types
Since data types are completely decoupled from the engine, it is fairly straight forward to add support for custom data types. Implement the DevelMe\RestfulList\Contracts\Orchestration interface, taking care of the various calls the engine makes to the implementation with various filter/sort/paginate settings. A custom engine is also needed to handle your custom data type.
Instantiating the engine with a custom data type
All versions of restful-lists with dependencies
illuminate/database Version ~8.0
nesbot/carbon Version ^2.45
illuminate/http Version ~8.0