nicolaslopezj / searchable

A php trait to search laravel models
MIT License
2.01k stars 291 forks source link

The (where) clause doesn't work with (search) function! #108

Open Mahmoudz opened 8 years ago

Mahmoudz commented 8 years ago

When I run the where clause alone it work, and when I run the search alone it work, but when I combine both it always returns empty result!!!!

$result = Account::where('user_id', '=', $user->id)->search($this->query)->paginate();

My Model (Account) has:

    protected $searchable = [
        'columns' => [
            'accounts.url'      => 10,
            'accounts.note'     => 5,
        ],
        'joins' => [
            'users' => ['users.id', 'accounts.user_id'],
        ]
    ];
n1crack commented 7 years ago

Can you try https://github.com/nicolaslopezj/searchable/pull/127 ? I had same problem.

markwalet commented 7 years ago

I think #144 Will fix this problem