```php
<?php

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

$data = Request::get();

try {

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

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

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


    $query = "

        SELECT
            id,
            name,
            icon,
            image,
            slug,
            short_description,
            description,
            seo_content,
            meta_title,
            meta_description,
            meta_keywords,
            canonical_url,
            robots_index,
            schema_markup
        FROM categories
        WHERE slug = :slug
        AND status = 1
        LIMIT 1

    ";


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

    $stmt->execute([
        ':slug'=>$slug
    ]);


    $category = $stmt->fetch();


    if(!$category){
        Response::error("Category not found",404);
    }


    Response::success($category);


}
catch(Exception $e){

    Logger::log("system.log",$e->getMessage());

    Response::error("Server error",500);

}
