That should be entirely possible. You can add extra columns on a pivot table. https://laravel.com/docs/9.x/eloquent-factories#pivot-table-attributes
Nov 1, 2022
6
Level 4
Handle Many to Many with a field
I am having a situation where I have 2 tables users & products. I need a different price for many users.
So I am looking to make a pivot table that will handle users and products in many to many relationships. In that pivot table, I am planning to add a product_price field as well which will be further used for different prices for different users.
Just wanted to know if there is a better alternative.
Please or to participate in this conversation.