Laravel-admin: How to remove default filter ID for searching?

Created on 19 Jan 2017  ·  4Comments  ·  Source: z-song/laravel-admin

2017-01-18_1827

Please let me know how can I remove these default filter which search ID?

Most helpful comment

@smuzammilali

$grid->filter(function($filter){
    $filter->disableIdFilter();
});

All 4 comments

@smuzammilali

$grid->filter(function($filter){
    $filter->disableIdFilter();
});

Thank you it works also it's possible to remove the labels?
2017-01-20_1516

@z-song Any help regarding above issue?

Also can we use just one input field for all filters? which called just Search

@smuzammilali It's unable to remove the label currently.

For the second question:

$filter->where(function ($query) {

    $query->where('title', 'like', "%{$this->input}%")
        ->orWhere('content', 'like', "%{$this->input}%");

}, 'Search');

You can write the search query just use eloquent methods.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xiaalngf picture xiaalngf  ·  3Comments

abufalbo picture abufalbo  ·  3Comments

antranapp picture antranapp  ·  3Comments

greentornado picture greentornado  ·  3Comments

joernroeder picture joernroeder  ·  3Comments