original_string: public function attribute($key, $value)
      {
          if (! in_array($key, $this->allowedAttributes)) {
              throw new InvalidArgumentException("Attribute [{$key}] does not exist.");
          }
  
          $this->attributes[Arr::get($this->aliases, $key, $key)] = $value;
  
          return $this;
      }
code: public function attribute($key, $value)
      {
          if (! in_array($key, $this->allowedAttributes)) {
              throw new InvalidArgumentException("Attribute [{$key}] does not exist.");
          }
  
          $this->attributes[Arr::get($this->aliases, $key, $key)] = $value;
  
          return $this;
      }
code_tokens: public function attribute ( $ key , $ value ) { if ( ! in_array ( $ key , $ this -> allowedAttributes ) ) { throw new InvalidArgumentException ( "Attribute [{$key}] does not exist." ) ; } $ this -> attributes [ Arr :: get ( $ this -> aliases , $ key , $ key ) ] = $ value ; return $ this ; }
docstring: Set the value for a given attribute.
  
  @param  string  $key
  @param  mixed  $value
  @return $this
  
  @throws \InvalidArgumentException
docstring_tokens: Set the value for a given attribute .