P粉2183619722023-09-06 11:48:46
I've done it the following way:
$searchstring = '(victim OR suspect) AND crime NOT covid'; $searchstring = str_replace(" OR ", ' ', $searchstring); $searchstring = str_replace(" AND ", ' +', $searchstring); $searchstring = str_replace(" NOT ", ' -', $searchstring); $searchstring = '+'.$searchstring; $searchresult = RssItem::whereRaw("MATCH (description) AGAINST ('$searchstring' IN BOOLEAN MODE)")->get();
But maybe there is a better way? :-)