Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to get property 'name' of non-object on blade view for threads() rest is working #132

Open
vaibhavAnchal16 opened this issue Aug 27, 2018 · 0 comments

Comments

@vaibhavAnchal16
Copy link

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

    @foreach($inboxes as $inbox)
  • {{$inbox->withUser->name}}

    **Error is here**

    {{$inbox->thread->message}}

    {{$inbox->thread->humans_time}}
  • @Endforeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants