How to store emoji string in Database using Laravel with Orm Query -


i want store special char in database vice versa emotive when try save in database question marks.

please

in database.php file, make sure set charset , collation utf8mb4:

'mysql' => [             'driver'    => 'mysql',             'host'      => env('db_host', 'localhost'),             'database'  => env('db_database', 'forge'),             'username'  => env('db_username', 'forge'),             'password'  => env('db_password', ''),             'charset'   => 'utf8mb4',             'collation' => 'utf8mb4_unicode_ci', 

and emoji column should string:

$table->string('emoji');


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -