Answers for "how to set foreign key and dropIfExists in laravel database migration file"

PHP
6

foreign key in laravel migration

$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
Posted by: Guest on June-21-2021
0

laravel migration drop foreign keys

$table->dropIndex(['state']); // Drops index 'geo_state_index'
Posted by: Guest on November-30-2020

Code answers related to "how to set foreign key and dropIfExists in laravel database migration file"

Browse Popular Code Answers by Language