Do you love to use Kendo Grid on your website? Have you ever tried to manage it's state to return correct data? With the help of this package, it will only take you several seconds now. You just need to install our helper, and tell us on which model should it work... Done!
Install via composer
composer require zgabievi/kendo-grid-state
To use this package you only need to add Filterable
trait to your model
namespace App;
use Illuminate\Database\Eloquent\Model;
use Zgabievi\KendoGridState\Traits\Filterable;
class Post extends Model
{
use Filterable;
//
}
https://domain.com/api/posts?take=5
https://domain.com/api/posts?skip=5&take=2
https://domain.com/api/posts?sort[0][field]=title&sort[0][dir]=desc
https://domain.com/api/posts?filter[logic]=and&filter[filters][0][field]=title&filter[filters][0][operator]=eq&filter[filters][0][value]=POST_TITLE
- filter?
- filters[]
- field? (string | Function)
- ignoreCase? (boolean)
- operator ("eq", "neq", "isnull", "isnotnull", "lt", "lte", "gt", "gte", "startswith", "endswith", "contains", "doesnotcontain", "isempty", "isnotempty")
- value? (any)
- logic ("or", "and")
- filters[]
- group?[]
- aggregates?[]
- aggregate ("count", "sum", "average", "min", "max")
- field (string)
- dir? ("asc", "desc")
- field (string)
- aggregates?[]
- skip? (number)
- sort?
- dir? ("asc", "desc")
- field (string)
- take? (number)
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email zura.gabievi@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License file for more information.