I want to disable foreign key constraint on a relationship because I have a problem after:
php artisan migrate:refresh
How can I solve it?
In 5.5 you can just use the fresh
command:
php artisan migrate:fresh
The
migrate:fresh
command will drop all tables from the database and then execute the migrate command
You can disable foreign key constraints in your migration file.
Schema::disableForeignKeyConstraints();
Ref: Laravel migrations nice way of disabling foreign key checks