Looks like what you want is a many-to-many relationship. An invoice has many products. A product has many invoices. In order to achieve that, you need something called the "pivot" table, which is the middle table that you created.
Docs: http://laravel.com/docs/5.1/eloquent-relationships#inserting-many-to-many-relationships
In this case, Laravel expects the pivot table to have the id, invoice_id, and product_id columns. However, since you also have an extra column for quantity, you need to tell Laravel about that. The docs do a good job of explaining it. Also, since it looks like you're already subscribed to Jeffrey, you can also watch his video on many-to-many relationships. :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community