Laravel 5 questions about utf8 eloquence

I am using Laravel 5.1 and mysql server. I have a database with a table in unicode utf8, and my database configuration file looks like this:

'mysql' => array(
'driver'    => 'mysql',
'host'      => 'localhost',
'database'  => 'database',
'username'  => 'root',
'password'  => 'password',
'charset'   => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix'    => 'false',
),

But when I use requests from the eloquent, my accented texts are violated. This is not a problem with the blade, because I can correctly write accent in the views, and if I use PDO directly, my text will be pleasant.

How can I solve my problem with my eloquent requests?

+4
source share
1 answer

I found my problem, hope this helps others:

Mysql latin1. , utf8, laravel.

+4

Source: https://habr.com/ru/post/1608351/


All Articles