Laravel Adding Cascade On Delete To An Existing Table

In my laravel application I have a table called researces and another one called papers. They have one-to-many relationship where each research can have one or more papers. In papers migration file I created the foreignkey constraints using:

        //foreign key for the research model

Now I want to create a new migration to add cascade onDelete so that papers are deleted when their parent research is deleted. How do I do it? I'm using laravel 5.1


SO the answer is very similar to the one accepted, except that I had to delete the column first and then add the foreign key. since I'm not in the production yet, so dropping the column is not a problem but if you are in a production environment you could end up messing with the consistency of data in your database. so be careful



Drop foreign key first then add it


Reference: Laravel -> Database: Migrations -> Foreign Key Constraints