title: Add lists() method in Query Builder in Laravel 5.4
body: <p><br></p>
  
  <p>I know the fact that Laravel has removed <code>lists()</code> function and moved functions signature as <code>pluck()</code>. But, this leads to a lot of work for someone who wants to Upgrade from <strong>Laravel 4.x to Laravel 5.4</strong>. </p>
  
  <p>Hence, I am trying to find a way to just make use of existing function i.e. <code>lists()</code> in my code and just make use of <code>pluck()-&gt;toArray()</code> when this function is called. </p>
  
  <h2><br><strong>I have tried the following.</strong></h2>
  
  <h2>Method 1</h2>
  
  <pre><code>class BaseModel extends  Illuminate\Database\Query\Builder
  public function __call($method, $args)
  {
      return call_user_func_array($this-&gt;method,$args);
  }
  
  public function lists($column){
  return $this-&gt;pluck($column)-&gt;toArray();
  }
  </code></pre>
  
  <p>Wont work!.<br> 
  <strong>Reason :</strong> This needs to be extended along with the BaseModel class. But, it already extends Eloquent Model Class.</p>
  
  <h2>Method 2</h2>
  
  <p>Tried adding the Required function using <code>trait</code> like</p>
  
  <p><strong><em>listsWorkAround.php</em></strong></p>
  
  <pre><code>&lt;?php
  trait listsWorkAround
  { 
    function lists($column){
      return $this-&gt;pluck($column)-&gt;toArray();
    }
  }
  </code></pre>
  
  <p><strong><em>Model.php</em></strong></p>
  
  <pre><code>&lt;?php
  namespace App;
  
  use Watson\Rememberable\Rememberable;
  use Illuminate\Database\Eloquent\Model as Eloquent;
  
  abstract class Model extends Eloquent
  {
      use listsWorkAround;
      use Rememberable;
  }
  </code></pre>
  
  <p>Nope ain't no success.</p>
  
  <h2>Method 3</h2>
  
  <p>Tried adding a as <code>ServiceProvider</code> and add a <code>macro</code> function for the <code>Builder</code> Class i.e. <code>lists</code> in this case.<br>
  But, the problem is the final returned entity is a Collection no matter what as it is returned using the <code>__call</code> function of the Builder. But, the desired entity is an <code>Array</code>.</p>
  
  <blockquote>
    <p>Edit : The Code I used for Method 3</p>
  </blockquote>
  
  <pre><code>&lt;?php
  namespace Providers;
  use Illuminate\Database\Query\Builder;
  use Illuminate\Support\ServiceProvider;
  
  class ListsWorkAround extends ServiceProvider
  {
      /**
       * {@inheritdoc}
       */
      public function register()
      {
          Builder::macro("lists", function ($column) {        
              return $this-&gt;pluck($column)-&gt;toArray();
          });
      }
  }
  </code></pre>
  
  <p>But, as I said this would still return Collection.</p>