misc_pterodactyl-panel/app/Http/Middleware/MaintenanceMiddleware.php

28 lines
538 B
PHP
Raw Normal View History

2018-05-04 13:02:51 +00:00
<?php
namespace Pterodactyl\Http\Middleware;
use Closure;
class MaintenanceMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$server = $request->attributes->get('server');
$node = $server->node;
if ($node->maintenance) {
return response(view('errors.maintenance'));
}
return $next($request);
}
}