I have a DB with a column of null values but now I want to change it for nullable(false).
Doing a migration I tried
$table->string('route',50)->nullable(false)->default('000 route')->change();
but it says
SQLSTATE[01000]: Warning: 1265 Data truncated for column 'route' at row 1 (SQL: ALTER TABLE address CHANGE route VARCHAR(50) DEFAULT '000 route' NOT NULL COLLATE utf8mb4_unicode_ci)
Is there any way to do it using Laravel migration?
Thank you in advance.