title: Laravel - SELF:: usage in models
body: <p>so I got this model that has only <strong>$fillable</strong> defined, no <strong>$table</strong> in it.</p>
  
  <p>The model has this function:</p>
  
  <pre><code>public static function gamesToday()
  {
      return self::where('status', self::STATUS_FINISHED)-&gt;where('created_at', '&gt;=', Carbon::today())-&gt;count();
  }
  </code></pre>
  
  <p>The model works correctly and returns the correct value, but how does it know from which table to return the value?</p>
  
  <p>Is there a way to define the <strong>$table</strong> somewhere else?</p>
  
  <p>Or am I misunderstanding how <code>self::</code> works?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In views it's used like this:</p>
  
  <pre><code>&lt;div class="totalGamesPlayed"&gt;{{ \App\Game::gamesToday() }}&lt;/div&gt;
  </code></pre>