title: Update the table name at runtime not working - laravel Eloquent ORM
body: <p>This is my model:</p>
  
  <pre><code>class Product extends \GlobalModel {
      protected $table = 'product';
  }
  </code></pre>
  
  <p>I want to update the table name <strong>oops_product</strong> instead <strong>product</strong> at runtime.</p>
  
  <p>I found <strong>getTable();</strong> to get the table name from model and its working fine:</p>
  
  <pre><code>$tableName = with(new Product)-&gt;getTable();
  </code></pre>
  
  <p>But when i set the table name using <strong>setTable();</strong> as per <a href="https://github.com/laravel/framework/issues/1716" rel="noreferrer">GitHub</a> solution, its not updating the table name.</p>
  
  <pre><code>with(new Product)-&gt;setTable("oops_produdct");
  </code></pre>
  
  <p>Is there anything wrong? </p>
  
  <p>Help will be appreciated.</p>
  
  <p>edited:</p>
  
  <pre><code>$product = new Product(); 
  $product-&gt;getTable(); // output: product 
  $product-&gt;setTable("oops_product"); 
  $product-&gt;getTable(); // output: oops_product 
  </code></pre>
  
  <p>now when i run this</p>
  
  <pre><code>$product-&gt;all(); 
  </code></pre>
  
  <p>it executes </p>
  
  <pre><code>"select * from product" 
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>"select * from oops_product"
  </code></pre>