DEV Community

Discussion on: New migration methods in Laravel 7

Collapse
ssembara profile image
Sebastianus Sembara • Edited on
Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});
Enter fullscreen mode Exit fullscreen mode

in script to define foreign key constraint like in Laravel 7 , How the script can detect references on table users or any table? there is not script has to define table_name