Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the search method name ? #186

Open
ysyap1104 opened this issue Jan 10, 2019 · 1 comment
Open

How to change the search method name ? #186

ysyap1104 opened this issue Jan 10, 2019 · 1 comment

Comments

@ysyap1104
Copy link

Hi everyone,

Im using searchable traits in my website and I would like to know how can I change the method name search into something else?

Ex: user::search($query) to user::searchScope($query)

Thank you for your help.

@trijulio
Copy link

trijulio commented Feb 2, 2020

You can find the SearchableTrait.php file and cange the name of the Scope

    public function scopeSearch(Builder $q, $search, $threshold = null, $entireText = false, $entireTextOnly = false)
    {
        return $this->scopeSearchRestricted($q, $search, null, $threshold, $entireText, $entireTextOnly);
    }

To:


    public function scopeSearchScope(Builder $q, $search, $threshold = null, $entireText = false, $entireTextOnly = false)
    {
        return $this->scopeSearchRestricted($q, $search, null, $threshold, $entireText, $entireTextOnly);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants