0 votes

Hi,
in a Many-to-many relationship, how I can set the 'on delete' and 'on update' properties?
Thanks

in Solved by (180 points)
recategorized by

1 Answer

0 votes

Hello,

I believe you're asking how to do that in Doctrine2 ORM, right?

If so, you need to select one of two associations leading from MN entity and configure on-delete and on-update.

Each direction is configured independently.

enter image description here

by Skipper developer (136k points)

Hi,
the project is in Laravel.
In ORM Properties I haven't the on-delete field...

enter image description here

Thanks!

Oh, ok. Sorry.

Regarding Laravel, there is no mention about on-update/on-delete for many-to-many relation in Laravel Eloquent documentation. Because of that, we didn't implement it.

In case that Laravel supports it, please post here any documentation link or the other source based on what we can implement it.

Thanks