Schema Builder length of an integer

前端 未结 6 939
一整个雨季
一整个雨季 2021-01-01 21:17

I\'ve been searching around and the question was asked a few times, but no-one seem to be able to give a definite answer to it. How do you specify the integer length for the

6条回答
  •  耶瑟儿~
    2021-01-01 21:45

    yes, it is possible to change the length of a default column by using:

    $table->string('any_text',35)->change();
    

    you can also make it nullable by using:

    $table->string('any_text',35)->nullable()->change();
    

    I hope it works for you :)

提交回复
热议问题