PHP code example of croudtech / request-filters
1. Go to this page and download the library: Download croudtech/request-filters library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
croudtech / request-filters example snippets
use CroudTech\RequestFilters\RequestFilters;
request()->macro('filters', function() {
return RequestFilters::getFilterCollection(
// Use the 'filters' query param.
request()->query('filters')
);
});
public function getFood()
{
return request()->filters()->apply(
DB::table('food')
);
}