| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function handle($request, Closure $next, $part) |
||
| 24 | { |
||
| 25 | $lockFilename = 'framework/partial-down-'.Str::slug($part); |
||
| 26 | |||
| 27 | if (file_exists(storage_path($lockFilename))) { |
||
| 28 | $data = json_decode(file_get_contents(storage_path($lockFilename)), true); |
||
| 29 | |||
| 30 | if (isset($data['allowed']) && IpUtils::checkIp($request->ip(), (array) $data['allowed'])) { |
||
| 31 | return $next($request); |
||
| 32 | } |
||
| 33 | |||
| 34 | throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $next($request); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |