Puedes notar queEn la documentación, selectRaw()
recibe segundo parámetro opcional, pero tú le estás enviando más de dos parámetros. Esto:
->selectRaw('visits.first_name as first_name', 'visits.last_name as last_name', 'users.first_name as firstname','users.last_name as lastname')
Debería ser:
->selectRaw('visits.first_name as first_name, visits.last_name as last_name, users.first_name as firstname, users.last_name as lastname')