public function check(Request $request)
    {
        //first check the exemptions. If the request passes any of
        //these, skip all other rules and grant explicit access.
        foreach ($this->exemptions as $exemption) {
            try {
                if (true === $this->checkRule($request, $exemption)) {
                    return true;
                }
                //catch any exceptions - a failed exemption shouldn't
                //fail the firewall entirely. Just move to on to the
                //next one.
            } catch (BlockadeException $e) {}
        }

        //check the rules. If they fail they will throw exceptions.
        foreach ($this->rules as $rule) {
            $this->checkRule($request, $rule);
        }

        //all rules have passed, but we can't be sure the request is
        //good as there may be other firewalls. Returning false is
        //this Firewall saying 'not sure' to the FirewallListener.
        return false;
    }
public function check(Request $request)
    {
        //first check the exemptions. If the request passes any of
        //these, skip all other rules and grant explicit access.
        foreach ($this->exemptions as $exemption) {
            try {
                if (true === $this->checkRule($request, $exemption)) {
                    return true;
                }
                //catch any exceptions - a failed exemption shouldn't
                //fail the firewall entirely. Just move to on to the
                //next one.
            } catch (BlockadeException $e) {}
        }

        //check the rules. If they fail they will throw exceptions.
        foreach ($this->rules as $rule) {
            $this->checkRule($request, $rule);
        }

        //all rules have passed, but we can't be sure the request is
        //good as there may be other firewalls. Returning false is
        //this Firewall saying 'not sure' to the FirewallListener.
        return false;
    }
public function check ( Request $ request ) { //first check the exemptions. If the request passes any of //these, skip all other rules and grant explicit access. foreach ( $ this -> exemptions as $ exemption ) { try { if ( true === $ this -> checkRule ( $ request , $ exemption ) ) { return true ; } //catch any exceptions - a failed exemption shouldn't //fail the firewall entirely. Just move to on to the //next one. } catch ( BlockadeException $ e ) { } } //check the rules. If they fail they will throw exceptions. foreach ( $ this -> rules as $ rule ) { $ this -> checkRule ( $ request , $ rule ) ; } //all rules have passed, but we can't be sure the request is //good as there may be other firewalls. Returning false is //this Firewall saying 'not sure' to the FirewallListener. return false ; }
Check if a Request has permission to access a resource.

@param  Request $request The request to check
@return Boolean true if the request is granted explicit access
via an exemption, false if the request passed but has not been
granted explicit access (allowing other firewalls to check)
@throws AuthenticationException if the request is not authenticated
@throws AuthorizationException  if the request is not authorized
Check if a Request has permission to access a resource .