Cant understand Eloquent distinct

Posted 8 months ago by alexMafus

Hi i have a function that filter my users and now i want to show me unique users by first name but when i use this code show me only the first name how to filter unique users by first name and to show all of user data here is my code

 })->when($search_status, function ($query) use ($search_status) {
            return $query->select('first_name')->distinct();

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.