Update an existing column in an existing table in Laravel migration?
Is there a way to update a column in a Laravel migration? For example, I have a body column in the reviews table, and I would like to make it nullable (preferably without having to re-migrate everything), but I'm not sure how to do it. Is it like adding a new column to an existing table?
I only found a tutorial online on how to change a table name via migration.
public function up()
{
Schema::table('reviews', function (Blueprint $table) {
$table->text('body')->nullable()->change();
});
}
public function down()
{
Schema::table('reviews', function (Blueprint $table) {
$table->text('body')->nullable(false)->change();
});
}