Answers for "how do i delete a foreign key database column in laravel migration"

PHP
8

laravel migration remove column

public function up()
{
  Schema::table('table', function($table) {
    $table->dropColumn('column_name');
  });
}
Posted by: Guest on April-16-2020
1

laravel drop foreign key

// Primary table name, from Schema::table(<table>)
// Primary column, from $table->foreign(<column>)
$table->dropForeign('<table>_<column>_foreign');
Posted by: Guest on December-22-2021

Code answers related to "how do i delete a foreign key database column in laravel migration"

Browse Popular Code Answers by Language