<?php
namespace App\Controllers;

require_once BASE_PATH . '/app/helpers/permissions.php';
use App\Core\Controller;
use App\Core\Database;

class PublicController extends Controller
{
    public function index(): void
    {
        $db = Database::getInstance();
        $articles = $db->query("
            SELECT id,title,doi,published_at
            FROM submissions
            WHERE stage='published'
            ORDER BY published_at DESC
        ")->fetchAll();

        require BASE_PATH.'/app/views/public/index.php';
    }
}
