how to show only unique users by name in eloquent?
Is any way to get the unique users filter by name or email so to not show the users with same email for example in eloquent ?
groupBy() and you're done?
You want that the search on name retrieve only one "John" even if you have 10 "John" users ?
use ->first() to retrieve data.
dosent work
Could you be more specific ?
Server has crashed ? You got a 404 error ? The code dropped your users table ?
})->when($unique_name, function ($query) {
return $query->>where('first_name', 'like', '%'.$unique_name.'%')
->take(1);
search to is not in the scope so it dosent work
Updated with, I guess, the correct variable.
Please or to participate in this conversation.