How can I filter users by their full name in Laravel when concatenating columns for a search?
$dataQuery = $dataQuery->where(function ($query) use ($fullname) { $nameParts = explode(' ', $fullname); if (count($nameParts) === 2) { $query->where(function ($q) use ($nameParts) { $q->where('users.firstname', 'like', '%' . $nameParts[0] . '%') ->where('users.lastname', 'like', '%' . $nameParts[1] . '%'); }); } else {…