I'm trying to convert a json column name with path 'foo->bar' to be compatible with mysql/postgresql using Laravel's wrapJsonSelector() method.
How can I access this method from the query builder calling getGrammar throws error:
Method Illuminate\Database\Query\Grammars\MySqlGrammar::isJsonSelector does not exist.
Eg
$query->where(function (Builder $query) use ($searchColumn): Builder {
if ($query->getGrammar()->isJsonSelector($searchColumn)) {
$searchColumn = $query->getGrammar()->wrapJsonSelector($searchColumn);
}
// ...
})