Answers for "laravel migration change key to nullable"

PHP
2

foreign key nullable in laravel

$table
      ->foreignId('other_table_id')
      ->nullable() // here
      ->references('id')
      ->on('other_table');
Posted by: Guest on October-01-2021
2

laravel migration table column nullable

$table->string(/*column name*/, /*size*/)->nullable(true);
Posted by: Guest on October-19-2021

Code answers related to "laravel migration change key to nullable"

Browse Popular Code Answers by Language