I'm getting the following error
(1/1) ErrorException
compact(): Undefined variable: operator
This is my line of code
$postsCat = Post::whereHas('Cat', function($query) use ($sreachWord) {
return $query->whereRaw('name REGEXP"'.sql_text_to_regx($sreachWord).'"');
})->orderBy('top','desc')
->orderBy('updated_at','desc')
->paginate(30);
Why is this happening? Is it because of my PHP version (7.3) or something else?