示例#1
0
        }
    });
    Route::get('base64/{text}', function ($text) {
        return json_encode(["encode" => base64_encode($text)]);
    });
    Route::get('decode/{text}', function ($text) {
        return json_encode(["encode" => base64_decode($text)]);
    });
    Route::get('encargado/{id}', function ($id) {
        return Encargado::where('id', $id)->orWhere('identidad', $id)->with('alumnos', 'alumnos.centro_educativo', 'alumnos.centro_educativo.municipio', 'alumnos.centro_educativo.departamento')->get();
    });
    Route::get('alumnos/{id}', function ($id) {
        return Alumno::where('id', $id)->orWhere('identidad', $id)->with('encargado')->get();
    });
    Route::get('municipio/{id}', function ($id) {
        return Municipio::where('id', $id)->with('departamento')->get();
    });
    Route::get('departamento/{id}', function ($id) {
        return Departamento::where('id', $id)->with('municipios')->get();
    });
});
// API
Route::group(['prefix' => 'api'], function () {
    Route::get('encargado', function () {
        $r = checkSesion();
        if ($r["status"] == "error") {
            return $r;
        }
        return ["status" => "exito", "data" => Session::get('encargado')];
    });
    Route::get('mensajes', function () {