Support the ongoing development of Laravel.io →
Database Queues
Last updated 2 years ago.
0

Hi mitq,

You have two way to do that:

  • Use group by sql You can group your result by the id
User::groupBy('users.id');
  • Use distinct sql
User::distinct();

You can saw usage on this page http://laravel.com/docs/4.2/queries

Cheers,

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mitq mitq Joined 4 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.