Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request, Redirector $redirect)
 {
     //otra manera de incertar sin esperar parametros
     //$user = User::create(Request::all());
     //redirect->()->route('admin.users.index');
     $user = new User($request->all());
     $user->full_name = $request->first_name . " " . $request->last_name;
     $user->save();
     return $redirect->route('admin.users.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateUserRequest $request, Redirector $redirect)
 {
     //otra manera de incertar sin esperar parametros
     //$user = User::create(Request::all());
     //redirect->()->route('admin.users.index');
     $user = new User($request->all());
     $confirm = \Request::input('password_confirmation');
     $user->full_name = $request->first_name . " " . $request->last_name;
     if (Hash::check($confirm, $user->password)) {
         $user->save();
         return $redirect->route('admin.users.index');
     } else {
         return $redirect->back();
     }
 }