original_string: protected function resolveDynamicExecution(string $method): array
      {
          // Preserve legacy CRUD structure for actions and roles.
          $method = Str::snake($method, '_');
          $matcher = '/^(add|rename|has|get|remove|fill|attach|detach)_(role|action)(s?)$/';
  
          if (! \preg_match($matcher, $method, $matches)) {
              throw new InvalidArgumentException("Invalid keyword [$method]");
          }
  
          $type = $matches[2].'s';
          $multiple = (isset($matches[3]) && $matches[3] === 's');
          $operation = $this->resolveOperationName($matches[1], $multiple);
  
          return [$type, $operation];
      }
code: protected function resolveDynamicExecution(string $method): array
      {
          // Preserve legacy CRUD structure for actions and roles.
          $method = Str::snake($method, '_');
          $matcher = '/^(add|rename|has|get|remove|fill|attach|detach)_(role|action)(s?)$/';
  
          if (! \preg_match($matcher, $method, $matches)) {
              throw new InvalidArgumentException("Invalid keyword [$method]");
          }
  
          $type = $matches[2].'s';
          $multiple = (isset($matches[3]) && $matches[3] === 's');
          $operation = $this->resolveOperationName($matches[1], $multiple);
  
          return [$type, $operation];
      }
code_tokens: protected function resolveDynamicExecution ( string $ method ) : array { // Preserve legacy CRUD structure for actions and roles. $ method = Str :: snake ( $ method , '_' ) ; $ matcher = '/^(add|rename|has|get|remove|fill|attach|detach)_(role|action)(s?)$/' ; if ( ! \ preg_match ( $ matcher , $ method , $ matches ) ) { throw new InvalidArgumentException ( "Invalid keyword [$method]" ) ; } $ type = $ matches [ 2 ] . 's' ; $ multiple = ( isset ( $ matches [ 3 ] ) && $ matches [ 3 ] === 's' ) ; $ operation = $ this -> resolveOperationName ( $ matches [ 1 ] , $ multiple ) ; return [ $ type , $ operation ] ; }
docstring: Dynamically resolve operation name especially to resolve attach and
  detach multiple actions or roles.
  
  @param  string  $method
  
  @throws \InvalidArgumentException
  
  @return array
docstring_tokens: Dynamically resolve operation name especially to resolve attach and detach multiple actions or roles .