uniqid(), 'title' => $title, 'content' => $content, 'created' => date('Y-m-d'), 'updated' => date('Y-m-d') ]; } Stories::save($story); echo json_encode(['success' => true]); } catch (Exception $e) { http_response_code(500); echo json_encode(['error' => $e->getMessage()]); }