Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel migration make column nullable

Schema::table('users', function($table)
{
    $table->string('name', 50)->nullable()->change();
});

This is the correct syntax to revert the migration:

$table->integer('user_id')->unsigned()->nullable(false)->change();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #migration #column #nullable
ADD COMMENT
Topic
Name
2+4 =