title: LARAVEL Getting 2 of the same columns
body: <p>I have a table that has animals and another that has the images of the animals (id_image, id_animal).</p>
  
  <p>The problem is that when I do this:</p>
  
  <pre><code>$animales = DB::table('animals')
  -&gt;orderBy('date_found')
  -&gt;join('images','images.id_animal','animals.id')
  -&gt;limit(6)
  -&gt;get();
  </code></pre>
  
  <p>When I do that it returns the same animal for each image that has. That is a problem becuase when I display all the animals it shows the same one multiple times
  <a href="https://i.stack.imgur.com/Uro9Z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uro9Z.jpg" alt="Example"></a></p>
  
  <p>What can I do? I tried to use group but it doesn't work.</p>
  
  <p>Thanks!</p>
  
  <pre><code> [1]=&gt;
      object(stdClass)#348 (15) {
        ["id"]=&gt;
        int(5)
        ["id_user"]=&gt;
        NULL
        ["race"]=&gt;
        string(7) "Mestizo"
        ["species"]=&gt;
        string(6) "Canina"
        ["gender"]=&gt;
        string(5) "Macho"
        ["date_of_birth"]=&gt;
        string(10) "2017-01-19"
        ["description"]=&gt;
        string(54) "Un perrito muy bonito y pequeño que busca una familia"
        ["health"]=&gt;
        string(8) "Muy bien"
        ["nickname"]=&gt;
        string(6) "Tudels"
        ["place_found"]=&gt;
        string(8) "Valencia"
        ["size"]=&gt;
        string(7) "Mediano"
        ["date_found"]=&gt;
        string(10) "2017-03-01"
        ["condition"]=&gt;
        NULL
        ["id_animal"]=&gt;
        int(1)
        ["url"]=&gt;
        string(18) "/img/animals/7.jpg"
      }
      [2]=&gt;
      object(stdClass)#347 (15) {
        ["id"]=&gt;
        int(1)
        ["id_user"]=&gt;
        NULL
        ["race"]=&gt;
        string(7) "Mestizo"
        ["species"]=&gt;
        string(6) "Canina"
        ["gender"]=&gt;
        string(5) "Macho"
        ["date_of_birth"]=&gt;
        string(10) "2017-01-19"
        ["description"]=&gt;
        string(54) "Un perrito muy bonito y pequeño que busca una familia"
        ["health"]=&gt;
        string(8) "Muy bien"
        ["nickname"]=&gt;
        string(6) "Tudels"
        ["place_found"]=&gt;
        string(8) "Valencia"
        ["size"]=&gt;
        string(7) "Mediano"
        ["date_found"]=&gt;
        string(10) "2017-03-01"
        ["condition"]=&gt;
        NULL
        ["id_animal"]=&gt;
        int(1)
        ["url"]=&gt;
        string(19) "/img/animals/1.jpeg"
      }
  </code></pre>