jsadways / scopefilter
There is no license information available for the latest version (1.0.2) of this package.
1.0.2
2024-12-19 07:26 UTC
README
composer require jsadways/scopefilter
Use Keys
- keyword
- or
- and
- OrRelation_or
- AndRelation_or
- OrRelation_and
- AndRelation_and
- column : columnName_operator => value
Edit Model
use Jsadways\ScopeFilter\ScopeFilterTrait;
class User extends Model
{
...
use ScopeFilterTrait;
...
}
Example
class UserController extends Controller
{
$filter = [
'keyword' => 'johnny',
'status_eq' => 1,
'or' => [
'tel_k' => '0922',
'titke_k => 'super'
],
'andRelation_or' => [
'education' => [
'school_name_k' => 'National'
]
]
];
$user_list = User::filter($filter)->get();
}