Laravel Version
12.48.1
PHP Version
8.4
Database Driver & Version
No response
Description
Invalid validation in compileIndexHint
Illuminate/Database/Query/Grammars/MySqlGrammar.php
if (! preg_match('/^[a-zA-Z0-9_$]+$/', $index)) {
throw new InvalidArgumentException('Index name contains invalid characters.');
}
MySql can use multiply index https://dev.mysql.com/doc/refman/8.4/en/index-hints.html
Need add \s+ and (,)
Steps To Reproduce
$builder->useIndex('user_id, PRIMARY')