display logged in user firstname and last name instead of email in php laravel
<p>I'm using Laravel and I'm trying to get logged in user first name and last name. The problem is: I can easily get the user email from user table because it is in user table.
But the first and last name is from other table which is contacts table.</p>

<p>Here I want to get user first and last name from contacts table which is separated from user table any help would be highly appreciated?</p>

<p>My code code snippet is </p>

<pre><code>  @if(Auth::check())
      &lt;li&gt;&lt;a href="{{ url('/admin') }}" class="btn btn-success" style="margin-top:8px;"&gt;Hi {{Auth::user()-&gt;email}}&lt;/a&gt;&lt;/li&gt;
  @else
      &lt;li&gt;&lt;a href="{{ url('/login') }}" class="btn btn-success" style="margin-top:8px;"&gt;Login&lt;/a&gt;&lt;/li&gt;
  @endif`
</code></pre>