title: Laravel Query - pulling value from array
body: <p>this has been driving me nuts...</p>
  
  <p>I'm in my view I'm calling</p>
  
  <pre><code>Auth::user()-&gt;userlists
  </code></pre>
  
  <p>which brings me back an array of values like</p>
  
  <pre><code>{"id":"1","user_id":"1","name":"list1".....}
  </code></pre>
  
  <p>all I want to do is bring back the names I've tried all these;</p>
  
  <pre><code>Auth::user()-&gt;userlists-&gt;name
  Auth::user()-&gt;userlists()-&gt;name
  Auth::user()-&gt;userlists-&gt;name-&gt;get()
  Auth::user()-&gt;userlists.name
  </code></pre>
  
  <p>But I always get an error such as "Undefined property"</p>
  
  <p>How do I return this single property, it's in my array for all the items but I'm clearly just getting the syntax incorrect...?</p>
  
  <p>The reason i'm trying to do this is that I need the values placed in a drop down box, it's finding the correct rows in the table but displaying all the data instead of just the name</p>
  
  <pre><code>Form::select('userlist_id', Auth::user()-&gt;userlists);
  </code></pre>
  
  <p>Many thanks.</p>