I'm new in Laravel and I want to make an API that returns values of my database and I have a table that containts routes of travels where the username is and when a user contains an underscore, it doesn't return that value.
What can I do instead of don't allow users to have an underscore in his name?
The select is:
$ruta = DB::table('rutas')
->join('personas', 'rutas.creador_id', '=', 'personas.id')
->join('hacen', 'personas.id', '=', 'hacen.persona_id')
->select('rutas.id', DB::raw('SYSDATE()'),'rutas.ciudad_origen', 'rutas.calle_origen', 'rutas.ciudad_destino',
'rutas.calle_destino','rutas.fecha_salida', 'rutas.hora_salida', 'rutas.fecha_vuelta',
'rutas.hora_vuelta', 'rutas.periodico', 'rutas.precio_plaza', 'rutas.plazas_disponibles',
'rutas.autopista','rutas.peajes','rutas.flexibilidad', 'rutas.distancia', 'rutas.vehiculo_id',
'personas.nombre', 'personas.apellidos', 'personas.fecha_nacimiento', 'personas.foto', 'hacen.tipo_persona')
->distinct()
->where(DB::raw('str_to_date(concat(rutas.fecha_salida, " ", rutas.hora_salida),"%Y-%m-%d %H:%i:%s")'), '>=', DB::raw('SYSDATE()'))
->orderBy('rutas.fecha_salida','ASC')
->get();
And it only returns the travels of the users in "personas" table, that doesn't cointain an underscore in his username.