I have a name
column that belongs to the Producer_BVU
model, whose names are:
2M1J
A. Coelho
ÓRBITA
Bruno
When I order:
\App\Producer_BVU::orderBy('name', 'ASC')->get();
The output is:
ÓRBITA
2M1J
A. Coelho
Bruno
Is there any way, preferably without modifying mysql's charset settings, in this query% with% accents being ignored?
Whose desired result is:
2M1J
A. Coelho
Bruno
ÓRBITA
It can be with some laravel function after extraction of the data without problem, it does not have to be soon in the call to the database, to cut until I prefer.
My settings in config / database for mysql:
...
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
...