Example #1
0
});
$app->post('/houses_tenants', function () use($app, $db) {
    $array = (array) json_decode($app->request()->getBody());
    $data = $db->houses_tenants()->insert($array);
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
$app->post('/houses_deposits', function () use($app, $db) {
    $array = (array) json_decode($app->request()->getBody());
    $data = $db->houses_deposits()->insert($array);
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
$app->post('/tenants_deposits', function () use($app, $db) {
    $array = (array) json_decode($app->request()->getBody());
    $data = $db->tenants_deposits()->insert($array);
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
$app->post('/owners', function () use($app, $db) {
    $array = (array) json_decode($app->request()->getBody());
    $data = $db->owners()->insert($array);
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data['id']);
});
$app->post('/deposits', function () use($app, $db) {
    $array = (array) json_decode($app->request()->getBody());
    $data = $db->deposits()->insert($array);
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data['id']);
});