Skip to content
Advertisement

Trying to get property ‘name’ of non-object laravel 8 and livewire

I am getting the error when I try to edit products in my eCommerce project. I can not find where i doing the mistake. when i am trying to edit product it give me the error. i am begginer to laravel 8. i can not find where to look for as it shows me the declared variables list.

my class file

JavaScript

Advertisement

Answer

yes.query returning array or object? If you dump it out, you might find that it’s an array and all you need is an array access ([]) instead of an object access (->). product is not null and I found the answer. i changed -> to [] and it worked.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement