mercredi 15 février 2017

Laravel Database charset and collation

In Laravel, Everytime, while running the website,

"set names 'utf8' collate 'utf8_unicode_ci'"

is executing.

How can I avoid this ? Instead of doing this in the code. We have configured in the database itself. How can I remove charset and collation in database configuration ?

> config/database.php
> 
> 'database' => [
>     'driver'    => 'mysql',
>     'host'      => env('DB_HOST', 'localhost'),
>     'port'      => env('DB_PORT'),
>     'database'  => env('DATABASE'),
>     'username'  => env('DB_USERNAME', 'forge'),
>     'password'  => env('DB_PASSWORD', ''),
>     'charset'   => 'utf8', // Need to remove or make ''
>     'collation' => 'utf8_unicode_ci', // Need to remove or make ''
>     'prefix'    => env('DB_PREFIX', ''),
>     'strict'    => false, ],



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire