private function shouldShowSudo($request) {
        // only show the sudo view if the sudo_last_time session value either
        // does not exist, the sudo_active value does not exist, or the maximum
        // duration has passed
        $sudo_last_time = session('sudo_last_time');
        $sudo_active = session('sudo_active');
        if(empty($sudo_last_time) || empty($sudo_active)) {
            session(['sudo_active' => false]);
            return true;
        }
        else if(Carbon::now()->diffInMinutes
            (Carbon::createFromFormat('Y-m-d H:i:s', $sudo_last_time)) > config('sudo.duration')) {
            session(['sudo_active' => false]);
            return true;
        }

        return false;
    }
private function shouldShowSudo($request) {
        // only show the sudo view if the sudo_last_time session value either
        // does not exist, the sudo_active value does not exist, or the maximum
        // duration has passed
        $sudo_last_time = session('sudo_last_time');
        $sudo_active = session('sudo_active');
        if(empty($sudo_last_time) || empty($sudo_active)) {
            session(['sudo_active' => false]);
            return true;
        }
        else if(Carbon::now()->diffInMinutes
            (Carbon::createFromFormat('Y-m-d H:i:s', $sudo_last_time)) > config('sudo.duration')) {
            session(['sudo_active' => false]);
            return true;
        }

        return false;
    }
private function shouldShowSudo ( $ request ) { // only show the sudo view if the sudo_last_time session value either // does not exist, the sudo_active value does not exist, or the maximum // duration has passed $ sudo_last_time = session ( 'sudo_last_time' ) ; $ sudo_active = session ( 'sudo_active' ) ; if ( empty ( $ sudo_last_time ) || empty ( $ sudo_active ) ) { session ( [ 'sudo_active' => false ] ) ; return true ; } else if ( Carbon :: now ( ) -> diffInMinutes ( Carbon :: createFromFormat ( 'Y-m-d H:i:s' , $ sudo_last_time ) ) > config ( 'sudo.duration' ) ) { session ( [ 'sudo_active' => false ] ) ; return true ; } return false ; }
Returns whether the sudo screen should be shown based upon either the
fact that it has not yet been shown or that the active duration has
passed.

@param \Illuminate\Http\Request $request
@return bool
Returns whether the sudo screen should be shown based upon either the fact that it has not yet been shown or that the active duration has passed .