Laravel - MySQL - Bypass database foreign key conditional constraint, force delete
MySQL under the command SET FOREIGN_KEY_CHECKS=0, can forcibly delete the associated source, sometimes when we just want to test, it will be very useful and will not be stuck.
In Laravel, you can delete records or clear data tables in this way
DB::statement('SET FOREIGN_KEY_CHECKS=0'); WalletDetail::truncate();
0 Comments