protected function validate($request, $user, $password, $routeUsername = null, $routePassword = null)
    {
        // If we're dealing with a route with a route specific restriction, it takes priortity over global restriction.
        if ($this->specificRouteRestrictionExists()) {

            // If we have a route specific username and password, check against them.
            if ($routeUsername && $routePassword) {

                // Check against route password
                if (trim($user) == $routeUsername && trim($password) == $routePassword) {
                    return true;
                } else {
                    return false;
                }

            }
        }
        // Check if global username and password are set
        elseif (($globalUsername = config('laravel-route-restrictor.global.username')) && ($globalPassword = config('laravel-route-restrictor.global.password'))) {
            
            // Check against global password
            if (trim($user) == $globalUsername && trim($password) == $globalPassword) {
                return true;
            } else {
                return false;
            }
        }

        return true;
    }
protected function validate($request, $user, $password, $routeUsername = null, $routePassword = null)
    {
        // If we're dealing with a route with a route specific restriction, it takes priortity over global restriction.
        if ($this->specificRouteRestrictionExists()) {

            // If we have a route specific username and password, check against them.
            if ($routeUsername && $routePassword) {

                // Check against route password
                if (trim($user) == $routeUsername && trim($password) == $routePassword) {
                    return true;
                } else {
                    return false;
                }

            }
        }
        // Check if global username and password are set
        elseif (($globalUsername = config('laravel-route-restrictor.global.username')) && ($globalPassword = config('laravel-route-restrictor.global.password'))) {
            
            // Check against global password
            if (trim($user) == $globalUsername && trim($password) == $globalPassword) {
                return true;
            } else {
                return false;
            }
        }

        return true;
    }
protected function validate ( $ request , $ user , $ password , $ routeUsername = null , $ routePassword = null ) { // If we're dealing with a route with a route specific restriction, it takes priortity over global restriction. if ( $ this -> specificRouteRestrictionExists ( ) ) { // If we have a route specific username and password, check against them. if ( $ routeUsername && $ routePassword ) { // Check against route password if ( trim ( $ user ) == $ routeUsername && trim ( $ password ) == $ routePassword ) { return true ; } else { return false ; } } } // Check if global username and password are set elseif ( ( $ globalUsername = config ( 'laravel-route-restrictor.global.username' ) ) && ( $ globalPassword = config ( 'laravel-route-restrictor.global.password' ) ) ) { // Check against global password if ( trim ( $ user ) == $ globalUsername && trim ( $ password ) == $ globalPassword ) { return true ; } else { return false ; } } return true ; }
Validates the user, password combination against the request.

@param \Illuminate\Http\Request $request
@param string                   $user
@param string                   $password
@param string                   $routeUsername
@param string                   $routePassword

@return bool
Validates the user password combination against the request .