title: htmlspecialchars() expects parameter 1 to be string, object given for join query
body: <p>I have a column named user_id in avtivities table. Now i want to fetch the names of user whose user_id stored in activities_table. So far i tried this </p>
  
  <pre><code>$activity_user=DB::table('users')
                  -&gt;join('activities','users.id','activities.user_id')
                  -&gt;select('users.name')-&gt;first();
  </code></pre>
  
  <p>but when i try to call it on view like this</p>
  
  <pre><code>&lt;td style="text-align: center"&gt;{{ $activity-&gt;user_id ? $activity_user : ""}}&lt;/td&gt;
  </code></pre>
  
  <p>i got this error</p>
  
  <pre><code>htmlspecialchars() expects parameter 1 to be string, object given (View: C:\xampp\htdocs\task-management-system\resources\views\super_admin\home.blade.php)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/bm2Ya.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bm2Ya.png" alt="enter image description here"></a></p>