title: Querying inside a blade view in laravel
body: <p>hi i was trying to do a query like</p>
  
  <pre><code>{{ \App\User::where(['name' =&gt; $posts-&gt;username])-&gt;pluck('avatar') }}
  </code></pre>
  
  <p>however this query outputs something like this</p>
  
  <pre><code>["1486468548.jpg"]
  </code></pre>
  
  <p>i was expecting </p>
  
  <pre><code>1486468548.jpg
  </code></pre>
  
  <p>so that it can actually be read. any ideas on how to remove the blocks and quotes??? i know it is not a good practise to query in blade but with my code flow i dont know how else to ge the user avatars.</p>
  
  <p>My controller looks like this. its where the posts are generated from. is there a way i can get the user avatar with a value of <strong>posts</strong> table. I know it exists but i dont know how</p>
  
  <pre><code>public function getDashboard()
  {
      $posts = Post::orderBy('created_at', 'desc')-&gt;get();
  
      return view('home', ['post' =&gt; $posts]);
  }
  </code></pre>