Schema::table(\'posts\', function (Blueprint $table) {
$table->integer(\'user_id\')->unsigned();
$table->foreign(\'user_id\')->references(\'id\')->
Short answer is: in your case, if you deleted a user, all posts related to him will be deleted too.
onDelete('cascade'); simply adds ON DELETE CASCADE rule to your database which specifies that the child data gets deleted when the parent data is deleted.
Note: take care of the typo (double semicolon)
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');