php - Today when I was learning laravel, I saw a problem with the foreign key constraints on the document.
PHP中文网
PHP中文网 2017-05-16 13:02:27
0
1
336

1. First I generated three tables

< /p>

< /p>

article_tag is associated with the article table and tags table respectively

2. Then I conducted some code testing

$article = \App\Article::destroy(21);
dd($article);

In my mind, when I delete the data in the articles table, the 21 data corresponding to the article_tag table in the third table will also be deleted, but the actual situation is not deleted

I want to know where I made the wrong picture description

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
大家讲道理

Laravel Eloquent does not have automatic cascade deletion function

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template