コード例 #1
0
 /**
  * Store a newly created user in storage.
  *
  * @return Response
  */
 public function store()
 {
     if (!$this->validator->validate(Input::all())) {
         return Redirect::route('users.create')->withErrors($this->validator->getErrors())->withInput();
     }
     $user = array('email' => Input::get('email'), 'password' => Input::get('password'), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'));
     if ($user = $this->users->create($user)) {
         return Redirect::route('users.index');
     }
     return Redirect::route('users.create')->withErrors(array('error' => $this->users->getError()));
 }
コード例 #2
0
 /**
  * If registration enabled store a newly registered user in storage.
  */
 public function store()
 {
     if (!Config::get('laravel-sentry-backend::enable_registrations')) {
         return App::abort(404);
     }
     if ($this->auth->check()) {
         return Redirect::route('profile.index');
     }
     if (!$this->validator->validate(Input::all())) {
         return Redirect::route('profile.create')->withErrors($this->validator->getErrors())->withInput();
     }
     $user = array('email' => Input::get('email'), 'password' => Input::get('password'), 'first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'));
     if ($user = $this->users->create($user)) {
         $this->activation->send($user);
         return Redirect::route('session.create')->with('success_registration', true);
     }
     return Redirect::route('profile.create')->withErrors(array('error' => $this->users->getError()));
 }