You can add a where clause in your SQL to do the filtering. Use CONCAT.
If you allready got the collection you can do
$clients = $clients->filter(function($client) use ($compareTo){
return $client->user->fullname() == $compareTo;
});
or
$clients = $clients->filter(function($client) use ($compareTo){
return $client->user->name.' '.$client->user->surname == $compareTo;
});
If I got you
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community