title: Laravel flatten and pluck from multidimensional collection
body: <p>I have to retrieve just an array of <strong>id</strong> from the given collection, something like <strong>[10,54,61,21,etc]</strong>.
  I've tried <em>flatten</em>, <em>pluck</em>, but nothing seems to work apart from a <em>foreach</em> which is something I would like to remove at this step.</p>
  
  <pre><code>// Model
  class Children extends Eloquent {
      public function directChildrens(){
          return $this-&gt;hasMany('App\Children','father_id','id')-&gt;select('id','father_id');
      }
  
      public function childrens(){
          return $this-&gt;directChildrens()-&gt;with('childrens');
      }
  }
  
  // Controller
  return $children-&gt;childrens()-&gt;get();
  </code></pre>
  
  <p>As expected it works fine. Here a result:</p>
  
  <pre><code>[{
  "id": 10,
  "father_id": 2,
  "childrens": [
      {
          "id": 54,
          "father_id": 10,
          "childrens": [
              {
                  "id": 61,
                  "father_id": 54,
                  "childrens": []
              }
          ]
      },
      {
          "id": 21,
          "father_id": 10,
          "childrens": []
      }
  ]
  }]
  </code></pre>
  
  <p>How can I perform a <em>pluck('id')</em> of this collection in order to get <strong>[10,54,61,21]</strong> ?</p>