public function save(array $rules = array(), array $customMessages = array(), array $options = array(), Closure $beforeSave = null, Closure $afterSave = null)
 {
     if ($this->translatableSave($options)) {
         return parent::save($rules, $customMessages, $options, $beforeSave, $afterSave);
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * Overwrites the original save method 
  * @return User object
  */
 public function save(array $rules = array(), array $customMessages = array(), array $options = array(), \Closure $beforeSave = null, \Closure $afterSave = null)
 {
     $id = $this->getKey();
     if (empty($id)) {
         $this->confirmation_code = md5(uniqid(mt_rand(), true));
     }
     // If it doesn't retrieve rules, so validation on Ardent fails
     if (!empty($this->remember_token) && empty($rules)) {
         $rules = static::$rules;
         $rules = array_diff(array_keys($rules), array('password_confirmation'));
     }
     $status = parent::save($rules, $customMessages, $options, $beforeSave, $afterSave);
     if ($this->errors()->isEmpty() && !$this->confirmed && \Config::get('laravel-helpers::auth.signup_email') == true) {
         $user = $this;
         //TODO use Mail::queue o Mail::queueOn
         Mail::send(Config::get('laravel-helpers::auth.email_view_account_confirmation'), compact('user'), function ($message) use($user) {
             $message->to($user->email)->subject(Lang::get('laravel-helpers::auth.email.account_confirmation.subject'));
         });
     }
     return $status;
 }
Exemplo n.º 3
0
 /**
  * Runs the real eloquent save method or returns
  * true if it's under testing. Because Eloquent
  * and Ardent save methods are not Confide's
  * responsibility.
  *
  * @param array $rules
  * @param array $customMessages
  * @param array $options
  * @param \Closure $beforeSave
  * @param \Closure $afterSave
  * @return bool
  */
 protected function real_save(array $rules = array(), array $customMessages = array(), array $options = array(), \Closure $beforeSave = null, \Closure $afterSave = null)
 {
     if (defined('CONFIDE_TEST')) {
         $this->beforeSave();
         $this->afterSave(true);
         return true;
     } else {
         /*
          * This will make sure that a non modified password
          * will not trigger validation error.
          * @fixed Pull #110
          */
         if (isset($rules['password']) && $this->password == $this->getOriginal('password')) {
             unset($rules['password']);
             unset($rules['password_confirmation']);
         }
         return parent::save($rules, $customMessages, $options, $beforeSave, $afterSave);
     }
 }
Exemplo n.º 4
0
 public function save(array $rules = array(), array $customMessages = array(), array $options = array(), Closure $beforeSave = null, Closure $afterSave = null)
 {
     $this->clearTaggedCaches();
     return parent::save($rules, $customMessages, $options, $beforeSave, $afterSave);
     // TODO: Change the autogenerated stub
 }