Open vaibhavAnchal16 opened 6 years ago
Hi I am tryng to list messages on my view but it does not fetches user table information with method withUser. It says tryng to get property of non-object . I am not aware of their model relationships.
My Controller code
$inboxes = Talk::user(auth()->user()->id)->threads(); return view('home',compact('inboxes'));
My View
{{$inbox->thread->message}}
Hi I am tryng to list messages on my view but it does not fetches user table information with method withUser. It says tryng to get property of non-object . I am not aware of their model relationships.
My Controller code
My View
@foreach($inboxes as $inbox)-
@endforeach
{{$inbox->withUser->name}}
**Error is here**{{$inbox->thread->message}}
{{$inbox->thread->humans_time}}