0

I'm having a frustrating experience with Laravel. I'm trying to get the Shippo code to work with my UserAddress and Cart Models for product shipping costs. When I do a regular die dump, I can see the details of my cart and the current user address from the UserAddress model. The problem is when I try to assign values like $address->name, I get the error Property[name] does not exist on this collection instance. I don't understand.

The property name has a value in the UserAddress model and table, and the variable $address = UserAddress::where('member_id,'id'). The member_id attribute is assigned to the authenticated user's id. I don't understand the Property[name] error.

D.T
  • 15
  • 5
  • Did you look up the answer to any of the other question on this site with the same error? Like https://stackoverflow.com/questions/41366092/property-title-does-not-exist-on-this-collection-instance, or https://stackoverflow.com/questions/57520700/property-products-does-not-exist-on-this-collection-instance-view?rq=1, etc etc. Chances are you have a Collection `UserAddress` records, and not a single one, and you're trying to access `name`, but the code doesn't know which record's name you're trying to get. – Tim Lewis Nov 15 '21 at 20:11

0 Answers0