Download the PHP package aripdev/queryable without Composer
On this page you can find all versions of the php package aripdev/queryable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aripdev/queryable
More information about aripdev/queryable
Files in aripdev/queryable
Package queryable
Short Description Laravel package for paginate, filter, sort and search query
License MIT
Informations about the package queryable
Laravel Queryable
This package handle common request for paginate,sort,filter and search data.
Table of Contents
- Getting started
- Inclusion
- Usage
- Methods
- paginated
- sorted
- filtered
- searched
- Extras
Getting Started
Install package
composer require aripdev/queryable
Inclusion
Add package to model that use queryable
Usage
This is how you can call some methods in your controller.
Methods
Available method
paginated
-
Controller
-
Url parameter
_limit
and_page
to limit your data.ex :
yourdomain/user?_page=1&_limit=5
note: default limit of paginated is 10 if user not bring paramater for _limit
in request
sorted
-
Controller
make sure the column exist in model by passing paramereter method,this example that we have column name in our model.
-
Url parameter
_sort
and optionaly_order
, default sorting is ascendingex :
yourdomain/user?_sort=name&_order=desc&_limit=2
filtered
-
controller
-
Url parameter that configure column in method filtered, in this example we filtered data with column
role
ex:
yourdomain/user?role=developer&_limit=2
searched
-
Controller
-
Url parameter like filtered method put parameter column that we want to search and we use column
title
and put the valueq
in urlex:
yourdomain/user?q=enginering
Extras
if you want to show the count data of every query,you can use xheader