Griehle
2 months ago

Pivot table data

Posted 2 months ago by Griehle

I have a Shop, or store, In Tinker I can access it

      $user->shop;

The Shop has Products and the products have types. But there is a pivot table there. So the type name can be anything. however, I cannot access it as

     $product->type;

or even

     $user->shop->product[0]->type; 

I have the relationships set as has many, it saves well everything seems to be working until I try to display the product with these addition. Or better for me. Trying to access the type and show all products. But.. I just cannot suss it. I hope it isn't too vague for help here.

Please sign in or create an account to participate in this conversation.