vendredi 16 septembre 2016

Bit Field in Schema Builder Laravel 5.3

I am following this article to search for the bit column type in Mysql Database Table

My Schema builder code is below.

if(!Schema::hasTable('tblrole')) {
    Schema::create('tblrole', function (Blueprint $table) {
        $table->integer('RoleID')->unsigned()->autoIncrement();
        $table->string('Role', 20);
        $table->boolean('IsActive')->default(false);
    });
}

I am concerned about column : IsActive which is right now Boolean type and get saved as tinyint in database.

Question

Is there any column type called bit in Laravel 5.3 Schema Builder? I just want to save two values for Active column. That is 0 or 1



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire