protected function middlewareAppliesToMethod($method, array $middleware)
    {
        if (!empty($middleware['only']) && !in_array($method, $middleware['only'])) {
            return false;
        } elseif (!empty($middleware['except']) && in_array($method, $middleware['except'])) {
            return false;
        }

        return true;
    }
protected function middlewareAppliesToMethod($method, array $middleware)
    {
        if (!empty($middleware['only']) && !in_array($method, $middleware['only'])) {
            return false;
        } elseif (!empty($middleware['except']) && in_array($method, $middleware['except'])) {
            return false;
        }

        return true;
    }
protected function middlewareAppliesToMethod ( $ method , array $ middleware ) { if ( ! empty ( $ middleware [ 'only' ] ) && ! in_array ( $ method , $ middleware [ 'only' ] ) ) { return false ; } elseif ( ! empty ( $ middleware [ 'except' ] ) && in_array ( $ method , $ middleware [ 'except' ] ) ) { return false ; } return true ; }
Determine if the middleware applies to a given method.

@param string $method
@param array  $middleware

@return bool
Determine if the middleware applies to a given method .