1
I made a field search however I am not able to search by date or 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;
}
$keyword
what can come from content in this variable? explain in your question the possible values?– novic