| Total Complexity | 1 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class TontineTemplate |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Handle an incoming request. |
||
| 19 | * |
||
| 20 | * @param Request $request |
||
| 21 | * @param Closure(Request): (Response|RedirectResponse) $next |
||
| 22 | * |
||
| 23 | * @return Response|RedirectResponse |
||
| 24 | */ |
||
| 25 | public function handle(Request $request, Closure $next) |
||
| 26 | { |
||
| 27 | $template = config('tontine.templates.app', 'default'); |
||
| 28 | $tontinePath = resource_path("views/tontine/app/$template"); |
||
| 29 | $paginationPath = "$tontinePath/parts/table/pagination"; |
||
| 30 | View::addNamespace('tontine', $tontinePath); |
||
| 31 | |||
| 32 | // Register the namespaces in the Jaxon view renderer. |
||
| 33 | $jaxonView = jaxon()->view(); |
||
| 34 | $jaxonView->addNamespace('tontine', $tontinePath, '.blade.php', 'blade'); |
||
| 35 | $jaxonView->addNamespace('pagination', $paginationPath, '.blade.php', 'blade'); |
||
| 36 | |||
| 37 | return $next($request); |
||
| 38 | } |
||
| 40 |