PHP code example of matthewerskine / request-filters
1. Go to this page and download the library: Download matthewerskine/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/ */
matthewerskine / request-filters example snippets
use MatthewErskine\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')
);
}