$table->unique(['customer_id','project_id','contact_id','role_id']);
I have a many to many pivot table with given columns above, this allows me to add different contacts, with different roles to different projects etc.... My attach method works fine but I am curious how I can detach, I was planning on providing a link (not a form button) to detach.
Should I set up an "id" column with an increments ( to make it unique for each record) or should i find someway to pass all that related information to method to detach (all four columns) and define it with wherePivot() or where()
What do you guys think?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire