I've made a search field but I'm not able to search by date or by id.
The database I use is Postgres, I'm using Laravel 5.2 framework
public function scopeSearchByKeyword($query, $keyword)
{
if ($keyword!='') {
$query->where(function ($query) use ($keyword) {
$query->where("nome_problema", "LIKE", "%$keyword%")
->orWhere("id", "LIKE", "%$keyword")
->orWhere("data_criacao", "LIKE", "%$keyword");
});
}
return $query;
}