Welcome Guest, Not a member yet? Register   Sign In
under maintenance
#7

(This post was last modified: 10-06-2022, 10:52 PM by davis.lasis.)

Problem: i have multiple routes files
I have created app with multiple modules, therefore each module has it's own routes file

I use filter for maintenance, but novadays we must echo the response in filter's before() method
PHP Code:
// Filter
public function before(RequestInterface $request$arguments null)
{
      if (!empty(getenv('maintenance'))) {
          echo FrontendMaintenanceController::maintenance();
          exit();
      }
}

// FrontendMaintenanceController
public static function maintenance()
{
    $maintenance getenv('maintenance');

    if (empty((string) $maintenance)) {
        return redirect()->route('frontend-homepage');
    }

    return view(service('settings')->get('FrontendSettings.theme_path').'Base/maintenance', ['deadline' => $maintenance]);

Reply


Messages In This Thread
under maintenance - by pippuccio76 - 09-30-2022, 03:58 AM
RE: under maintenance - by superior - 09-30-2022, 04:15 AM
RE: under maintenance - by pippuccio76 - 10-05-2022, 12:30 PM
RE: under maintenance - by kenjis - 10-05-2022, 03:26 PM
RE: under maintenance - by pippuccio76 - 10-06-2022, 10:21 AM
RE: under maintenance - by kenjis - 10-06-2022, 02:27 PM
RE: under maintenance - by davis.lasis - 10-06-2022, 10:49 PM
RE: under maintenance - by ikesela - 10-06-2022, 11:38 PM
RE: under maintenance - by davis.lasis - 10-07-2022, 01:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB