Make column not nullable in a Laravel migration

Prior to Laravel 5, there was no Laravel native way of altering an existing table column using the schema builder. You’d need to use raw queries for this.

However, as of Laravel 5 you can use:

$table->string('foo')->nullable(false)->change();

You must have the dbal dependency prior to running the above command:

composer require doctrine/dbal

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)