title: Show number of registers in a table in laravel 5
body: <p>I'd like to show the number of records in a table, and then show them, something like:  The number of records is: ((number) this with laravel 5.</p>
  
  <p>I have this function in the model of my table.</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Ingrediente extends Model
  {
      protected $fillable = ['nombre','proveedor'];
      public function mostrar(){
          $result = Ingrediente::count();
              return $result; 
      }
  }
  </code></pre>
  
  <p>And this is my index.</p>
  
  <pre><code> &lt;div class="card-body"&gt;
  
      &lt;a href="{{ route('ingredientes.create') }}" class="btn btn-primary"&gt;Crear Ingrediente&lt;/a&gt;
  
      @foreach($ingredientes as $ingrediente)
      &lt;small id="total" class="form-text text-muted"&gt;Hay un total de {{$ingrediente-&gt;mostrar}} ingredientes en el sistema.
      &lt;/small&gt;
  </code></pre>