Back
I'm writing a migration to make certain columns in a table nullable right now. For the down function, I, of course, want to make those columns not nullable again. I looked through the schema builder docs, but couldn't see a way to do this.
Any help would be appreciated.
There was no Laravel native way of altering an existing table column using the schema builder prior to Laravel 5. You need to use raw queries.
However, if you are using Laravel 5 use the below code:
$table->...->nullable(false)->change();
31k questions
32.8k answers
501 comments
693 users