Comment out the objects that you are trying to access e.g. {{ $variable->name }}, with blade comments {{-- --}} and run through them all including nested views and you will find the culprit :).
Or
dd() all the input sent to the view and find some null data.
matthewburrow said:
Comment out the objects that you are trying to access e.g. {{ $variable->name }}, with blade comments {{-- --}} and run through them all including nested views and you will find the culprit :).
Or
dd() all the input sent to the view and find some null data.
The diedump didn't give me anything unusual, and commenting the objects out didn't change anything. (also tried in the nested views) :(
Well something within the input will be NULL either not them or a property on objects within the input such as models etc.
This sounds like your object does not exist OR that it is an array...
This adding an "@" infront of the: $yourVar->value; to: @$yourVar->value;
OR
try this:
Change this: {{ $yourVar->value }} To: {{ $yourVar['value'] }}
Hard to tell without seeing any code...
Fixed it, after a loooonnnggg search the bug was in the database. Luckely i had a backup :)
Still odd that laravel gave me a complete different error.
lorienhd said:
Fixed it, after a loooonnnggg search the bug was in the database. Luckely i had a backup :)
Still odd that laravel gave me a complete different error.
It gave you the correct error, its just the data that you were trying to access was not there. I.e. from a relationship, if the relationship data does not exist, the attributes on that data would neither exists, leading to 'Trying to get property of non-object.'.
Well that solved my problem. Thanks for the suggestions. I am surprised why an array is returned although I did not use toArray() or anything, used just pure \App\Organization::paginate(15).
Thanks.
makzumi said:
This sounds like your object does not exist OR that it is an array...
This adding an "@" infront of the: $yourVar->value; to: @$yourVar->value;
OR
try this:
Change this: {{ $yourVar->value }} To: {{ $yourVar['value'] }}
Hard to tell without seeing any code...
makzumi said:
This sounds like your object does not exist OR that it is an array...
This adding an "@" infront of the: $yourVar->value; to: @$yourVar->value;
OR
try this:
Change this: {{ $yourVar->value }} To: {{ $yourVar['value'] }}
Hard to tell without seeing any code...
I had same error and this solution helps me to pass it. thanks in advanced!
makzumi said:
This sounds like your object does not exist OR that it is an array...
This adding an "@" infront of the: $yourVar->value; to: @$yourVar->value;
OR
try this:
Change this: {{ $yourVar->value }} To: {{ $yourVar['value'] }}
Hard to tell without seeing any code...
Thanks for the solution. It help me to. May i know where to read more on this? Thanks!
makzumi said:
This sounds like your object does not exist OR that it is an array...
This adding an "@" infront of the: $yourVar->value; to: @$yourVar->value;
OR
try this:
Change this: {{ $yourVar->value }} To: {{ $yourVar['value'] }}
Hard to tell without seeing any code...
Solved, Thanks :D
Hello, i have something like this
<p>Posted In:{{ $post->category->name }}</p>and the error is " Trying to get property of non-object " and i have also populated the database correctly :(
can you please suggest me a solution, thank you
(i have tried with @$post.. but it doesn't display any value)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community