PHP code example of thalfm / laravel-eloquent-filter
1. Go to this page and download the library: Download thalfm/laravel-eloquent-filter 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/ */
thalfm / laravel-eloquent-filter example snippets
composer
use \Thalfm\LaravelEloquentFilter\Traits\Filterable;
class User extends Authenticatable
{
use \Thalfm\LaravelEloquentFilter\Traits\Filterable;
namespace App\Filters;
use Thalfm\LaravelEloquentFilter\Filters\SimpleQueryFilter;
class UserFilter extends SimpleQueryFilter
{
protected $simpleFilters = ['id','created_at'];
protected $simpleSorts = ['id','email','created_at'];
}