```php
<?php

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

$data = Request::get();

try {

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

$query="

SELECT

b.id,
b.title,
b.slug,
b.featured_image,
b.status,
b.published_at,
c.name as category_name

FROM blog_posts b

LEFT JOIN blog_categories c
ON b.category_id = c.id

ORDER BY b.created_at DESC

";

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

$posts=$stmt->fetchAll();

Response::success($posts);

}
catch(Exception $e){

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

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

}