you can use searchable package it is easy and customizable and support joins .
Jan 28, 2015
4
Level 1
Search all the columns using laravel query builder
This is much of a sql related question. But I need to solve it in a laravel way. I have to implement a search functionality which makes search on every column of the table and join table. I have used postgres as database and query needs to be perfomed in json column type also.
My query looks like this
$cases = \DB::table('cases')
->join('services', 'cases.id', '=', 'services.case_id')
->where(function($query) use ($request)
{
$query->whereRaw('*', 'like', '%'.$request->get('query').'%');
})
->get();
I need to perfom where query to all columns.
Please or to participate in this conversation.