Conditions | 5 |
Paths | 5 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function handle($request, Closure $next): RedirectResponse |
||
25 | { |
||
26 | $updateEnabled = filter_var(config('installer.updaterEnabled'), FILTER_VALIDATE_BOOLEAN); |
||
27 | switch ($updateEnabled) { |
||
28 | case true: |
||
29 | $canInstall = new canInstall; |
||
30 | |||
31 | // if the application has not been installed, |
||
32 | // redirect to the installer |
||
33 | if (! $canInstall->alreadyInstalled()) { |
||
34 | return redirect()->route('LaravelInstaller::welcome'); |
||
35 | } |
||
36 | |||
37 | if ($this->alreadyUpdated()) { |
||
38 | abort(404); |
||
39 | } |
||
40 | break; |
||
41 | |||
42 | case false: |
||
43 | default: |
||
44 | abort(404); |
||
45 | break; |
||
46 | } |
||
47 | |||
48 | return $next($request); |
||
49 | } |
||
71 |