original_string: public function get($key, $format = null)
      {
          // If the message exists in the message bag, we will transform it and return
          // the message. Otherwise, we will check if the key is implicit & collect
          // all the messages that match the given key and output it as an array.
          if (array_key_exists($key, $this->messages)) {
              return $this->transform(
                  $this->messages[$key], $this->checkFormat($format), $key
              );
          }
  
          if (Str::contains($key, '*')) {
              return $this->getMessagesForWildcardKey($key, $format);
          }
  
          return [];
      }
code: public function get($key, $format = null)
      {
          // If the message exists in the message bag, we will transform it and return
          // the message. Otherwise, we will check if the key is implicit & collect
          // all the messages that match the given key and output it as an array.
          if (array_key_exists($key, $this->messages)) {
              return $this->transform(
                  $this->messages[$key], $this->checkFormat($format), $key
              );
          }
  
          if (Str::contains($key, '*')) {
              return $this->getMessagesForWildcardKey($key, $format);
          }
  
          return [];
      }
code_tokens: public function get ( $ key , $ format = null ) { // If the message exists in the message bag, we will transform it and return // the message. Otherwise, we will check if the key is implicit & collect // all the messages that match the given key and output it as an array. if ( array_key_exists ( $ key , $ this -> messages ) ) { return $ this -> transform ( $ this -> messages [ $ key ] , $ this -> checkFormat ( $ format ) , $ key ) ; } if ( Str :: contains ( $ key , '*' ) ) { return $ this -> getMessagesForWildcardKey ( $ key , $ format ) ; } return [ ] ; }
docstring: Get all of the messages from the message bag for a given key.
  
  @param  string  $key
  @param  string  $format
  @return array
docstring_tokens: Get all of the messages from the message bag for a given key .