Answers for "drop foreign key laravel 8"

PHP
1

larael drop foreign key

Schema::table('posts', function (Blueprint $table) {
	$table->dropForeign(['category_id']);
});
Posted by: Guest on May-07-2021
1

disable foreign key laravel

//...
class ClearOldOauthRelations extends Migration
{
    public function up()
    {
        Schema::disableForeignKeyConstraints();
        // drop foreign keys
        Schema::table('oauth_access_tokens', function (BluePrint $table) {
            $table->dropForeign('oauth_access_tokens_session_id_foreign');
        });
        //...
        Schema::enableForeignKeyConstraints();
    }
    //...
}
Posted by: Guest on October-06-2021
3

laravel remove foreign key

$table->dropForeign('posts_user_id_foreign');
Posted by: Guest on April-22-2020

Code answers related to "drop foreign key laravel 8"

Browse Popular Code Answers by Language