Closed sxzero closed 4 years ago
Also I tried to get the data converting the string $value to bool, changing the where query with numbers and operators but it fails too.
@sxzero
Use filter_var
function in your filter:
public function apply(Builder $builder, $value): Builder
{
return $builder->where('enable', filter_var($value, FILTER_VALIDATE_BOOLEAN));
}
See here for more details.
@sxzero I close this issue, but feel free to reopen it if you need.
I have a model Products, where in my DB I store a tinyinteger field enable that accepts only 0 or 1.
Query /products/search?enable=true
I tried to get the data from:
In my controller I have:
And my filter file have this:
And always the response is empty.
But, If I tried directly with
Returns the content.
Dev Packages