Set the message for the attribute with the given name.

@param string $name
@param string $message
@return \MadeSimple\Validator\Validator
341916
public function setAttributeMessage(string $name, string $message)
    {
        $this->messages['custom'][$name] = $message;
        return $this;
    }
931256
public function setName($name)
    {
        if (null !== $name) {
            $this->name = (string) $name;
        } else {
            $this->name = $name;
        }

        return $this;
    }
1331832
protected static function set($name, $message, $view)
    {
        $txt = "<?php\n\n";
        $txt .= "namespace App\Exception;\n\n";
        $txt .= "use Vinala\Kernel\Logging\Exception;\n\n";
        $txt .= self::docs("$name Exception");
        $txt .= "class $name extends Exception\n{\n\n";
        $txt .= "\t/**\n\t* The exception constructor\n\t*\n\t*/\n";
        $txt .= "\tfunction __construct()\n\t{\n";
        $txt .= "\t\t/**\n\t\t* The exception message\n\t\t*\n\t\t* @param string\n\t\t*/";
        $txt .= "\n\t\t".'$this->message = '."'$message';";
        $txt .= "\n\n\t\t/**\n\t\t* The exception view if debugging mode activated\n\t\t*\n\t\t* @param string\n\t\t*/";
        $txt .= "\n\t\t".'$this->view = '."'$view';";
        $txt .= "\n\t}\n}";

        return $txt;
    }
391368
public function time(string $name, string $message = null): TimerContract
    {
        $id = isset($this->timers[$name]) ? \uniqid($name) : $name;

        $this->timers[$id] = $this->createTimer($name, \microtime(true), $message);

        return $this->timers[$id];
    }
822451
public function addWarningMessage($message)
    {
        $namespace = $this->getNamespace();
        $this->setNamespace(self::NAMESPACE_WARNING);
        $this->addMessage($message);
        $this->setNamespace($namespace);

        return $this;
    }
468915
public function bcc($mail, $name = null)
    {
        $this->message->addBcc($mail, $name);
        return $this;
    }
317393
public function setAttribute(string $name, string $value) : Tag
    {
        $this->attributes[strtolower($name)] = $value;

        return $this;
    }
751665
public static function addRule($name, $callback, $message = 'error param')
    {
        if (!is_callable($callback)) {
            throw new \InvalidArgumentException('param $callback must can callable');
        }
        self::$errorTip[strtolower($name)] = $message;
        static::$rules[$name] = $callback;
    }
658299
public function admin($message, $name = 'Unknown User', $email = 'not-provided@example.com') {
  $mail = new Mail();
  $data = [
   'message'     => $message,
   'name'        => $name,
   'reply_email' => $email
  ];
  $mail->sendAdminMessage('Message to Admin', 'admin_message', $data);
  if ($email != 'not-provided@example.com') {
   $mail = new Mail();
   $mail->sendMessage([$email, $name], 'Message Sent to Admin', 'admin_message_user_copy', ['message' => $message]);
  }
  return array(
   'message' => 'Message sent'
  );
 }
504964
public function setTo($email, $name = '')
    {
        if (empty($email)) {
            throw new MailerException('email is required for setTo!');
        }

        if (empty($name)) {
            $name = substr($email, 0, strrpos($email, '@'));
        }

        if (is_null($this->to)) {
            $this->to = [$email, $name];
        } else {
            throw new MailerException('A master recipient has already been set!');
        }

        return $this;
    }
1191910
public static function generic($message = null, $CSSClass = null, $name = null)
    {
        // ensure that we are having a name as well as keeping it consistent with the original behaviour
        if ($name == null) {
            $name = md5($message);
        }

        return MessageBoxField::create(
            $name,
            $message
        )->addCSSClass($CSSClass);
    }
144058
public static function success($message = null, $name = null)
    {
        return self::generic($message, SuccessMessage::$CSSClass, $name);
    }
593837
public function from($mail, $name = null)
    {
        $this->mailer->setFrom($mail, $name);
        return $this;
    }
505634
protected function validateName($name)
    {
        if (!ApiKey::isValidName($name)) {
            return self::MESSAGE_ERROR_INVALID_NAME;
        }
        if (!ApiKey::nameExists($name)) {
            return self::MESSAGE_ERROR_NAME_DOES_NOT_EXIST;
        }
        return null;
    }
769655
public function setSenderName($name)
    {
        if (!$this->validateHeaderFieldValue($name)) {
            throw new EmailValidationException(__('Sender Name can not contain carriage return or newlines.'));
        }

        $this->_sender_name = $name;
    }
124578
public function message($message)
    {
        if (is_string($message) || is_numeric($message)) {
            $message = new Text($message);
        }

        if (!($message instanceof Message)) {
            throw new InvalidArgumentException('Invalid message.');
        }

        $this->message = $message;

        return $this;
    }
123919
public static function message($name, $message = null)
    {
        if (func_num_args() === 2) {
            return static::$_messages[$name] = $message;
        }
        return isset(static::$_messages[$name]) ? static::$_messages[$name] : static::$_messages['_default_'];
    }