<?php
namespace App\Controllers;
use App\Core\Auth;use App\Core\Permission;use App\Models\GlobalSearch;
final class GlobalSearchController { public function search(): void { Auth::requireLogin(); Permission::require('recherche.globale.use'); header('Content-Type: application/json; charset=utf-8'); header('Cache-Control: no-store'); echo json_encode(['results'=>GlobalSearch::search((string)($_GET['q']??''))],JSON_UNESCAPED_UNICODE); exit; } }
