refactor(pages): replace superglobals with request/session abstractions
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Http\SessionStoreInterface;
|
||||
use MintyPHP\I18n;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Service\Search\SearchDataService;
|
||||
use MintyPHP\Support\Guard;
|
||||
|
||||
$session = app(SessionStoreInterface::class)->all();
|
||||
Guard::requireLogin();
|
||||
gridRequireGetRequest();
|
||||
|
||||
@@ -14,7 +16,7 @@ if ($filters['q'] === '') {
|
||||
Router::json([]);
|
||||
}
|
||||
|
||||
$userId = (int) ($_SESSION['user']['id'] ?? 0);
|
||||
$userId = (int) ($session['user']['id'] ?? 0);
|
||||
$locale = I18n::$locale ?? (I18n::$defaultLocale ?? 'de');
|
||||
$result = app(SearchDataService::class)->buildPreviewData($userId, $filters['q'], $locale, 5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user