Leverage injected request object

Laravel automatically injects the current Http [request object][1] to all Controller actions and Middleware. Leveraging this object improves consistency and testability.

[1]: https://laravel.com/docs/requests#accessing-the-request
This commit is contained in:
Shift
2023-03-30 14:15:14 +00:00
parent ce9ce47010
commit 66c246852c
16 changed files with 82 additions and 79 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ class SearchController extends BasePageController
'basic',
$categoryID);
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, request()->url(), request()->query());
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query());
$this->smarty->assign(
[
@@ -155,7 +155,7 @@ class SearchController extends BasePageController
[$searchVars['searchadvcat'] === '' ? -1 : $searchVars['searchadvcat']]
);
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, request()->url(), request()->query());
$results = $this->paginate($rslt ?? [], $rslt[0]->_totalrows ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query());
$this->smarty->assign(
[