← Back
mainapp/controllers/ExploreController.php
<?php

class ExploreController
{
  public function explore(): void
  {
    $db = db();
    $st = $db->query("SELECT r.id, r.name, r.slug, r.description, r.created_at, u.username as owner
                      FROM repositories r
                      JOIN users u ON u.id = r.owner_id
                      WHERE r.visibility='public'
                      ORDER BY r.id DESC
                      LIMIT 100");
    $repos = $st->fetchAll();

    $title = "Explore";
    require __DIR__ . '/../views/explore.php';
  }
}