Schema::table(\'posts\', function (Blueprint $table) {
$table->integer(\'user_id\')->unsigned();
$table->foreign(\'user_id\')->references(\'id\')->
The code you are talking about creates a foreign key / reference to a column on another table. The onDelete('cascade')
means that when the row is deleted, it will delete all it's references and attached data too.
For example if you have a User which has a Post and you set onDelete('cascade') on the user, then when the user deletes his account, all posts will be deleted as well.
You can find more information on Laravel excellent documentation.