Reputation: 2469
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?
Upvotes: 10
Views: 7048
Reputation: 194
You can disable foreign key constraints in your migration file.
Schema::disableForeignKeyConstraints();
Ref: Laravel migrations nice way of disabling foreign key checks
Upvotes: 8
Reputation: 163788
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
Upvotes: 9