```php
<?php

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

$data = Request::post();

try {

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

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

$name = Helper::sanitize($data['name']);

/*
Generate unique slug
*/
$slug = Slug::generateUnique(
'blog_categories',
'slug',
$name
);

/*
Upload category image
*/
$image = null;

if(isset($_FILES['image'])){
$image = Upload::image('image','blog-categories');
}

$query = "

INSERT INTO blog_categories
(
name,
slug,
meta_title,
meta_description,
schema_markup,
image
)

VALUES
(
:name,
:slug,
:meta_title,
:meta_description,
:schema_markup,
:image
)

";

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

$stmt->execute([

':name'=>$name,
':slug'=>$slug,
':meta_title'=>$data['meta_title'] ?? null,
':meta_description'=>$data['meta_description'] ?? null,
':schema_markup'=>$data['schema_markup'] ?? null,
':image'=>$image

]);

$id = $conn->lastInsertId();

Logger::activity(
ApiAuth::employeeId(),
"create",
"blog_categories",
$id,
ApiAuth::ip()
);

Response::success([
"id"=>$id
],"Blog category created");

}
catch(Exception $e){

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

}