```php
<?php

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

require_once '../../services/crud_service.php';

require_once '../../core/employee_auth.php';

EmployeeAuth::check('manage_categories');



$data = Request::post();

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

$crud = new CrudService($conn);

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

$data['slug'] = Slug::generateUnique(
    'categories',
    'slug',
    $data['name']
);

$data['icon']  = Upload::image('icon','categories');
$data['image'] = Upload::image('image','categories');

$category_id = $crud->create('categories',$data);

Response::success([
    "category_id"=>$category_id
],"Category created");
