title: How to set Laravel Model table/collection dynamically?
body: <p>I am using GitHub - jenssegers/laravel-mongodb: A MongoDB based Eloquent model and Query builder for Laravel;
  In my Laravel project I created DB model that sets Model table name dynamically (in Mongodb case collection) . </p>
  
  <pre><code>use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
  
  class DbData extends Model
      {   
          protected   $collection = 'default_collection';
          function __construct($collection)
              {
                  $this-&gt;collection = $collection;
              }
      }
  </code></pre>
  
  <p>This works when I am creating new DbData object, for data insert:</p>
  
  <pre><code>$data = new DbData('dynamic_collection_name');
  $data-&gt;variable = 'Test';
  $data-&gt;save();
  </code></pre>
  
  <p>But this solution is not enough of I want to use this DbData model for querying data from my database.
      What I want to achieve is to add possibility to pass variable for DbModel, for instance something like this:</p>
  
  <pre><code>$data = DbData::setCollection('dynamic_collection_name');
  $data-&gt;get();
  </code></pre>