```php
<?php

require_once '../../core/api_bootstrap.php';

$data = Request::post();

try {

Validator::required($data,[
'id',
'title'
]);

$db = new Database();
$conn = $db->connect();

/*
Get category slug
*/
$cat = $conn->prepare("SELECT slug FROM categories WHERE id=:id");
$cat->execute([':id'=>$data['category_id']]);
$cat = $cat->fetch();

/*
Get city name
*/
$city = $conn->prepare("SELECT name FROM cities WHERE id=:id");
$city->execute([':id'=>$data['city_id']]);
$city = $city->fetch();

$citySlug = Slug::generate($city['name']);

$slug = $cat['slug']."-".$citySlug;

$query="

UPDATE service_city_pages

SET
category_id=:category_id,
sub_category_id=:sub_category_id,
city_id=:city_id,
slug=:slug,
title=:title,
content=:content,
meta_title=:meta_title,
meta_description=:meta_description,
meta_keywords=:meta_keywords,
schema_markup=:schema_markup

WHERE id=:id

";

$stmt=$conn->prepare($query);

$stmt->execute([

':id'=>$data['id'],
':category_id'=>$data['category_id'],
':sub_category_id'=>$data['sub_category_id'] ?? null,
':city_id'=>$data['city_id'],
':slug'=>$slug,
':title'=>$data['title'],
':content'=>$data['content'] ?? null,
':meta_title'=>$data['meta_title'] ?? null,
':meta_description'=>$data['meta_description'] ?? null,
':meta_keywords'=>$data['meta_keywords'] ?? null,
':schema_markup'=>$data['schema_markup'] ?? null

]);

Logger::activity(
ApiAuth::employeeId(),
"update",
"service_city_pages",
$data['id'],
ApiAuth::ip()
);

Response::success([
"slug"=>$slug
],"SEO page updated");

}
catch(Exception $e){

Logger::log("system.log",$e->getMessage());
Response::error("Server error",500);

}