| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function handle($request, Closure $next, $theme = null) |
||
| 18 | { |
||
| 19 | $theme = $theme ?: config('themes.frontend', 'default'); |
||
| 20 | |||
| 21 | $finder = app('themes.view.finder'); |
||
| 22 | $basePath = config('themes.path.frontend', base_path('themes/frontend')); |
||
| 23 | $finder->removeBasePath(); |
||
| 24 | $finder->setBasePath($basePath . DIRECTORY_SEPARATOR . $theme); |
||
| 25 | |||
| 26 | config(['themes.frontend' => $theme]); |
||
| 27 | |||
| 28 | return $next($request); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |