this is my simple code
$app->get(
'/users',
function () use ($app) {
$phql = "SELECT * FROM users";
$users = $app->modelsManager->executeQuery($phql);
$data = [];
foreach ($users as $user) {
$data[] = [
'id' => $user->id,
'email' => $user->email
];
}
echo json_encode($data);
}
);
but it always goes 500 (internal server error) in my browser, if i just echoing something, it works well,