Laravel migration for CHAR data type

Here we will discuss Laravel char type column migration. how to make char type migration.

Laravel char type migration

Laravel migration char() method create mysql CHAR type column. we can define this column length by passing in second argument

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->char('name');
        $table->char('username', 50);
    });
}
php laravel developer anmol sharma

Anmol Sharma

I am a software engineer and have experience in web development technologies like php, Laravel, Codeigniter, javascript, jquery, bootstrap and I like to share my deep knowledge by these blogs.

Random tutorial links