Replies: 1 comment 1 reply
-
Creating my pivot row like that : const caracteristiques: Caracteristique[] = []
if (caracteristiquesFields) {
for (let i = 0; i < caracteristiquesFields.length; ++i) {
caracteristiques[i] = await Caracteristique.findByOrFail('nom', caracteristiquesFields[i])
}
}
Materiel.$getRelation('caracteristiques').boot()
Materiel.$getRelation('caracteristiques').setRelated(materiel, caracteristiques)
await materiel.related('caracteristiques').saveMany(caracteristiques) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to set column "value" when creating a new "Materiel"
In Materiel Model :
In Caracteristique Model :
table STOCK_MATERIEL_CARACTERISTIQUES : [id, id_materiel, id_caracteristique, value]
Beta Was this translation helpful? Give feedback.
All reactions