Stevemo\Cpanel\Services\Validation\ValidableInterface::add PHP Метод

add() публичный Метод

Add a message to the bag.
Автор: Steve Montambeault
public add ( string $key, string $message )
$key string
$message string
    public function add($key, $message);

Usage Example

Пример #1
0
 /**
  * Reset a given user password
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param array $creds
  *
  * @return bool
  */
 public function reset(array $creds)
 {
     try {
         if ($this->validator->with($creds)->passes()) {
             $this->users->resetPassword($creds['code'], $creds['password']);
             return true;
         }
     } catch (UserNotFoundException $e) {
         $this->validator->add('UserNotFoundException', $e->getMessage());
     }
     return false;
 }
All Usage Examples Of Stevemo\Cpanel\Services\Validation\ValidableInterface::add