|
|
|
@ -16,17 +16,7 @@ class ApiPersonaController extends Controller |
|
|
|
return json_encode(['reply' => 'hola']); |
|
|
|
return json_encode(['reply' => 'hola']); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Show the form for creating a new resource. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
public function create() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Store a newly created resource in storage. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function store(Request $request) |
|
|
|
public function store(Request $request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$input = $request->input(); |
|
|
|
$input = $request->input(); |
|
|
|
@ -63,6 +53,25 @@ class ApiPersonaController extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function buscar($dni) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$persona = UaderMapuchePersona::where('nro_docum', $dni)->first(); |
|
|
|
|
|
|
|
if (!empty($persona)) { |
|
|
|
|
|
|
|
$dj = UaderDjPersona::find($persona->id_dj_persona); |
|
|
|
|
|
|
|
$datos = array( |
|
|
|
|
|
|
|
'id' => $dj->id_persona, |
|
|
|
|
|
|
|
'dni' => $persona->nro_docum, |
|
|
|
|
|
|
|
'apellido' => ucwords(strtolower(trim($persona->desc_appat))), |
|
|
|
|
|
|
|
'nombres' => ucwords(strtolower(trim($persona->desc_nombr))), |
|
|
|
|
|
|
|
'telefono' => '549'.preg_replace('([^0-9])', '', trim($persona->telefono_celular)), |
|
|
|
|
|
|
|
'email' => strtolower(trim($persona->correo_electronico)), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
return response()->json($datos); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return response()->json(array(), 404); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the specified resource. |
|
|
|
* Display the specified resource. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|