Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 2 years ago.
0
Solution

Found the solution. The problem was that I was trying to access this pivot through order collection. You have to access it through products collection than individual product and than you can do things like this:

$product->pivot->quantity;

Hope it helps someone.

Last updated 2 years ago.
0

This was really helpful! Thank you for posting this.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Joe5 joe5 Joined 26 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.