PHP code example of arielsand / mongodb-eloquent-api-filter-mapping
1. Go to this page and download the library: Download arielsand/mongodb-eloquent-api-filter-mapping 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/ */
arielsand / mongodb-eloquent-api-filter-mapping example snippets
class UserController extends Controller
{
use Arielsand\MoloquentApiFilter\Traits\FiltersMoloquentApi;
public function index(Request $request)
{
$users = User::query();
return $this->filterApiRequest($request, $users);
}
}
$this->filterApiRequest($request, $query);