DWQA QuestionsCategory: Laravelhow to change charater set in laravel ?
kandy asked 5 years ago

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCharaterSetToUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table(‘users’, function(Blueprint $table)
{
//$table->character = ‘utf8’;
DB::statement(‘ALTER TABLE usersCONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci’);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(‘users’, function(Blueprint $table)
{
//
});
}
}