Understanding onDelete cascade in laravel migrations
Posted: Sat Feb 11, 2017 1:49 pm
I was going through this section in the laravel documentation:
https://laravel.com/docs/5.4/migrations ... onstraints
I saw the below line of code:
I am not quite understanding the onDelete part , can somebody please explain that to me ?
Thank you.
Gautam.
https://laravel.com/docs/5.4/migrations ... onstraints
I saw the below line of code:
Code: Select all
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
Thank you.
Gautam.