getErrors() 공개 메소드

Get the validation errors
저자: Steve Montambeault
public getErrors ( ) : array
리턴 array
예제 #1
0
 /**
  * Register user
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postRegister()
 {
     if ($this->userForm->register(Input::all(), false)) {
         return Redirect::route('cpanel.login')->with('success', Lang::get('cpanel::users.register_success'));
     }
     return Redirect::back()->withInput()->withErrors($this->userForm->getErrors());
 }
예제 #2
0
 /**
  * Update user information
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param  int $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update($id)
 {
     try {
         $credentials = Input::except('groups');
         $credentials['groups'] = Input::get('groups', array());
         $credentials['id'] = $id;
         if ($this->userForm->update($credentials)) {
             return Redirect::route('cpanel.users.index')->with('success', Lang::get('cpanel::users.update_success'));
         }
         return Redirect::back()->withInput()->withErrors($this->userForm->getErrors());
     } catch (UserNotFoundException $e) {
         return Redirect::route('cpanel.users.index')->with('error', $e->getMessage());
     }
 }