vendredi 18 mars 2016

Maintenance mode in public page not in admin page [Laravel]

Now i'm working on laravel web project, there is the feature on admin page to set web as maintenance mode, but this maintenance just stop proceed the request which come in public page, I tried to make middleware so all route or controller which handle public page will stop if setting is set on maintenance mode. (settings are saved in database that has value 'online' or 'maintenance')

public function handle($request, Closure $next, $guard = null){
    // retrieve setting from database and turn into key value array
    if($site_settings['status'] == 'maintenance'){
        return response()->view('errors.500', [], 500);
    }

    return $next($request);
}

what my approach is incorrect?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire