wtf / middleware-filters
This package is abandoned and no longer maintained.
No replacement package was suggested.
Built for wtf/orm
README
Built for ORM package
Table of Contents
Installation
composer require wtf/middleware-filters
Add new middleware to your provider:
<?php $container['middleware_filters'] = function ($c) { return new \Wtf\Middleware\Filters($c); };
Add it to your suit.php
middleware list:
<?php //... 'middlewares' => [ //... 'middleware_filters', //... ],
Usage
Use medoo where conditions in your query, eg:
GET /?filter[name[~]]=Nich&limit=20&offset=20
=> array:
<?php [ 'name[~]' => 'Nich', 'LIMIT' => [20,20], ];
And inside your code:
<?php $collection = $this->entity('employee')->loadAll($this->container['filters']);