title: Eloquent "all()" method [Laravel 5.4]
body: <p>Eloquent is not returning me the data correctly (that's what I think).</p>
  
  <p>I'm getting null variables here.
  What should I do?</p>
  
  <p>When i do <code>dd(Productos::all());</code>
  it shows me what is showed below (the info I want lies in 'original' and 'attributes'):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Collection {#178 ▼
    #items: array:4 [▼
      0 =&gt; Productos {#179 ▼
        +id: null
        +id_categoria: null
        +nombre: null
        +precio: null
        +descripcion: null
        +created_at: null
        +udated_at: null
        #fillable: array:4 [▼
          0 =&gt; "id_categoria"
          1 =&gt; "nombre"
          2 =&gt; "precio"
          3 =&gt; "descripcion"
        ]
        #connection: null
        #table: null
        #primaryKey: "id"
        #keyType: "int"
        +incrementing: true
        #with: []
        #perPage: 15
        +exists: true
        +wasRecentlyCreated: false
        #attributes: array:7 [▼
          "id" =&gt; 1
          "id_categoria" =&gt; 1
          "nombre" =&gt; "Invitacion 1"
          "precio" =&gt; "75.000"
          "descripcion" =&gt; """
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut ultrices quam. Phasellus eget magna in justo cursus posuere. Curabitur porta, purus eu co ▶
            \n
            """
          "created_at" =&gt; "2017-04-27 21:19:41"
          "updated_at" =&gt; "2017-04-27 21:19:41"
        ]
        #original: array:7 [▼
          "id" =&gt; 1
          "id_categoria" =&gt; 1
          "nombre" =&gt; "Invitacion 1"
          "precio" =&gt; "75.000"
          "descripcion" =&gt; """
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut ultrices quam. Phasellus eget magna in justo cursus posuere. Curabitur porta, purus eu co ▶
            \n
            """
          "created_at" =&gt; "2017-04-27 21:19:41"
          "updated_at" =&gt; "2017-04-27 21:19:41"
        ]
        #casts: []
        #dates: []
        #dateFormat: null
        #appends: []
        #events: []
        #observables: []
        #relations: []
        #touches: []
        +timestamps: true
        #hidden: []
        #visible: []
        #guarded: array:1 [▼
          0 =&gt; "*"
        ]
      }
      1 =&gt; Productos {#180 ▼
        +id: null
        +id_categoria: null
        +nombre: null
        +precio: null
        +descripcion: null
        +created_at: null
        +udated_at: null
        #fillable: array:4 [▶]
        #connection: null
        #table: null
        #primaryKey: "id"
        #keyType: "int"
        +incrementing: true
        #with: []
        #perPage: 15
        +exists: true
        +wasRecentlyCreated: false
        #attributes: array:7 [▼
          "id" =&gt; 2
          "id_categoria" =&gt; 2
          "nombre" =&gt; "Invitacion 2"
          "precio" =&gt; "75.000"
          "descripcion" =&gt; """
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut ultrices quam. Phasellus eget magna in justo cursus posuere. Curabitur porta, purus eu co ▶
            \n
            """
          "created_at" =&gt; "2017-04-27 21:20:09"
          "updated_at" =&gt; "2017-04-27 21:20:09"
        ]
        #original: array:7 [▼
          "id" =&gt; 2
          "id_categoria" =&gt; 2
          "nombre" =&gt; "Invitacion 2"
          "precio" =&gt; "75.000"
          "descripcion" =&gt; """
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ut ultrices quam. Phasellus eget magna in justo cursus posuere. Curabitur porta, purus eu co ▶
            \n
            """
          "created_at" =&gt; "2017-04-27 21:20:09"
          "updated_at" =&gt; "2017-04-27 21:20:09"
        ]
        #casts: []
        #dates: []
        #dateFormat: null
        #appends: []
        #events: []
        #observables: []
        #relations: []
        #touches: []
        +timestamps: true
        #hidden: []
        #visible: []
        #guarded: array:1 [▼
          0 =&gt; "*"
        ]
      }
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Controller:</p>
  
  <pre><code>public function showAll(){
      return view('productos.index',[
                  'productos' =&gt; Productos::all()
                  ]);
  }
  </code></pre>
  
  <p>View:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@foreach($productos as $producto)
   &lt;div class="row"&gt;
    &lt;div class="col-sm-6 col-md-4"&gt;
      &lt;div class="thumbnail clearfix"&gt;
        &lt;img class="image-product" src="image.jpg" resposive alt="..."&gt;
        &lt;div class="caption"&gt;
          &lt;h3&gt;{{ $producto-&gt;nombre }}&lt;/h3&gt;
          &lt;p class="justify"&gt;
              {{ $producto-&gt;descripcion }}
          &lt;/p&gt;
          &lt;p&gt;&lt;a href="#" class="btn btn-primary pull-right" role="button"&gt;&lt;i class="fa fa-cart-plus"&gt;&lt;/i&gt; Añadir al carrito&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  @endforeach</code></pre>
  </div>
  </div>
  </p>