title: DB::table()-> select() ->where()->get(); Laravel
body: <p>I am trying here to select a data by id from a table, but only where certain other things exist. And it is just not working! I am thinking the problem lays in my database query. It either doesn't show me anything or only the first book.
  I hope someone can help me, I really tried everything!</p>
  <p>In my Model I tried:</p>
  <pre><code>public static function myWishlist(){
  $id = Auth::id();
  </code></pre>
  <hr />
  <pre><code>$book_id = DB::table('wishlist')-&gt;select('book_id')
          -&gt;where('user_id' ,  '=' ,  $id)
          -&gt;get();
      foreach ($book_id as $book){
      return Book::where('id', $book);
  </code></pre>
  <hr />
  <pre><code>$book_id= Wishlist::select('book_id')
  -&gt;where('user_id', $id)
  -&gt;get()-&gt;all();
  </code></pre>
  <hr />
  <pre><code>$book_id = DB::table('wishlist')
  -&gt;where('user_id', $id)
  -&gt;get('book_id');//-&gt;toArray();
  </code></pre>
  <hr />
  <pre><code>$book_id = DB::table('wishlist')
  -&gt;select('book_id')
  -&gt;where('user_id', $id)-&gt;first();
  </code></pre>
  <p>}</p>
  <p>I would be so happy for some help!</p>