I want to change the collation of the column "about_me" from "users" table. For that, I am using below code. I am simply changing the collation to utf8mb4_unicode_ci but the code is not working.
public function up()
{
if (Schema::hasColumn("users", "about_me")) {
Schema::table("users", function(Blueprint $table) {
$table->collation = 'utf8mb4_unicode_ci';
$table->charset = 'utf8mb4';
});
}
}
I already changed in /config/database.php, this helped me to save the data in db but after fetching the database, I found the special symbols are not displaying, when I changed the Collation of that column to utf8mb4_unicode_ci then it worked fine. But I want to make it in migration. The current code is not working, I need the correct code which works well.