vendredi 14 juin 2019

Set foreign key value to defualt value on delete in Laravel

I have a little issue that has been bothering me, I get the excess of the whole foreign key ideal, owever , could there be any way to get Laravel forign key to a defualt value whenever the reference table is deleted.

One reason I ask this is say for instance say a category is deleted, and the category has alot of say products, when ever the category is deleted the whole product goes along with it.

And then the use has to a new category and then recreate the product that was deleted.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire