title: How to show in a view using foreach, laravel?
body: <p>
  this is the blade.php</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h1&gt; Cadastro de clientes &lt;/h1&gt;
  
  &lt;hr/&gt;
  
  @if(count($cliente)&gt;0)
  &lt;ul&gt;
  @foreach($cliente as $cliente)
      &lt;li&gt;{{$nome-&gt;nome}}&lt;/li&gt;
      &lt;li&gt;{{$endereco-&gt;endereco}}&lt;/li&gt;
      &lt;li&gt;{{$email-&gt;email}}&lt;/li&gt;
      &lt;li&gt;{{$celular-&gt;celular}}&lt;/li&gt;
  @endforeach
  &lt;/ul&gt;
  @else
      &lt;h4&gt;Não há clientes&lt;/hr&gt;
  @endif
  </code></pre>
  
  <p>This is the model:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace App;
  
  Use Illuminate\Database\Eloquent\Model;
  
  class Cliente extends Model{
  
      protected $table = 'cliente';
      public $timestamps = false;
  }
  </code></pre>
  
  <p>and this is the controller:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  namespace App\Http\Controllers;
  
  use App\Http\Controllers\Controller;
  
  use Illuminate\Http\Request;
  
  use App\Cliente;
  
  class CadCliController extends Controller {
  
      public function cadCli() {
          $cliente = Cliente::all();
  
          $array = array('cliente'=&gt;$cliente);
  
  
          return view('cadCli', $array);
      }
  </code></pre>
  
  <p>I'm unable to show the table on foreach. keep showing the error that variable nome is undefined. Could you please help?....................................................................................</p>