Middleware

Maintenance:

Maintenance
  • Access .env file:

  • MAINTENANCE=false

RolePermission:

RolePermission:
  • Restrict page access for Players:

  • Limit access only for accounts with access > 0

$obRouter->get('/', [
    'middlewares' => [
        'role-permission'
    ],
    function($request){
        return new Response(200, Home::getHome($request));
    }
]);

RequireLogin:

RequireLogin
  • Check if the account is logged.

$obRouter->get('/', [
    'middlewares' => [
        'required-admin-login'
    ],
    function($request){
        return new Response(200, Home::getHome($request));
    }
]);
$obRouter->get('/', [
    'middlewares' => [
        'required-login'
    ],
    function($request){
        return new Response(200, Home::getHome($request));
    }
]);

RequireLogout:

RequireLogout
  • Check if the account is not logged.

$obRouter->get('/', [
    'middlewares' => [
        'required-logout'
    ],
    function($request){
        return new Response(200, Home::getHome($request));
    }
]);