当前位置: 首页>>代码示例>>PHP>>正文


PHP Requests\UserRequest类代码示例

本文整理汇总了PHP中App\Http\Requests\UserRequest的典型用法代码示例。如果您正苦于以下问题:PHP UserRequest类的具体用法?PHP UserRequest怎么用?PHP UserRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UserRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Store a newly created user in storage.
  *
  * @param UserRequest $request
  * @return Response
  */
 public function store(UserRequest $request)
 {
     $input = $request->only('username', 'email', 'password', 'password_confirmation');
     $this->userRepository->store($input);
     Flash::message('User created');
     return Redirect()->route('users');
 }
开发者ID:alons182,项目名称:guanacastevende,代码行数:13,代码来源:UsersController.php

示例2: update

 public function update(UserRequest $request, $id)
 {
     $user = User::find($id);
     if (!$user) {
         return ['error' => 1, 'message' => '用户不存在或已被删除!'];
     }
     switch ($request->get('attr')) {
         case 'admin':
             if ($user->is_admin > 0) {
                 if ($user->id == 1) {
                     return ['error' => 1, 'message' => '不能删除默认管理员账号!'];
                 }
                 $user->is_admin = 0;
                 $user->save();
                 return ['error' => 0, 'message' => '管理员权限移除成功!'];
             } else {
                 $user->is_admin = 1;
                 $user->save();
                 return ['error' => 0, 'message' => '管理员权限添加成功!'];
             }
             break;
         default:
             return ['error' => 1, 'message' => '不能修改该属性,请刷新!!'];
     }
 }
开发者ID:lakche,项目名称:timeCMS-free,代码行数:25,代码来源:UsersController.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update($id, Requests\UserRequest $request)
 {
     $user = User::findorFail($id);
     $user->update($request->all());
     session()->flash('flash_message', 'User Successfully Updated!');
     return redirect('users/' . $id . '');
 }
开发者ID:Gadurp1,项目名称:KD-2,代码行数:14,代码来源:UserController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param UserRequest $request
  * @param User $user
  * @return Response
  */
 public function update(UserRequest $request, User $user)
 {
     $user->update($request->all());
     $user->uploadAndSave();
     flash()->success("User has been successfully updated!");
     return redirect()->back()->withInput();
 }
开发者ID:vazmer,项目名称:mudrosti-laravel,代码行数:14,代码来源:UserController.php

示例5: update

 /**
  * Updates the User
  * 
  * @param  $id the id of the User to update
  * @param  UserRequest $request 
  */
 public function update($id, UserRequest $request)
 {
     $user = User::findOrFail($id);
     $user->update($request->all());
     flash()->success('User edited with success.');
     return redirect('admin/users');
 }
开发者ID:albertopereira,项目名称:iopac,代码行数:13,代码来源:UserController.php

示例6: store

 public function store(Requests\UserRequest $request)
 {
     $input = $request->all();
     $input['password'] = bcrypt($input['password']);
     User::create($input);
     return redirect(url('admin/user'));
 }
开发者ID:realphp,项目名称:laravel-cms,代码行数:7,代码来源:UserController.php

示例7: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(UserRequest $request, $id)
 {
     $request['password'] = bcrypt($request['password']);
     $user = User::findOrFail($id);
     $user->update($request->all());
     return redirect('/users');
 }
开发者ID:rdg577,项目名称:laravel-mis,代码行数:14,代码来源:UserController.php

示例8: update_user

 public function update_user(UserRequest $request, $username)
 {
     $user = Auth::user();
     $password_lama = $request->input('password_lama');
     if (!Hash::check($password_lama, $user->password)) {
         return redirect()->back()->with('error', 'Password lama yang anda masukkan salah.');
     }
     if ($request->input('password') == '') {
         $input['password'] = $user->password;
     } else {
         $input['password'] = bcrypt($request->input('password'));
     }
     return redirect()->route('admin::user')->with('message', 'Profil user telah diupdate...');
     /*if(bcrypt::check($newpassword, $oldpassword)){
     			$tes = User::findOrFail(5);
     			$tes->password = bcrypt::make(input::get('newpassword'));
     			$tes->save();
     		}
     		else{
     			var_dump('gagal');
     		}
     
     		$input = $request->all();
     		return redirect()->route('admin::user');*/
 }
开发者ID:rikoansh,项目名称:TracerStudy,代码行数:25,代码来源:AdminController.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(UserRequest $request)
 {
     $user = new User($request->all());
     $user->password = bcrypt($request->password);
     $user->save();
     return redirect()->route('admin.users.index')->with('message', 'El usuario ' . $user->name . ' se ha registrado');
 }
开发者ID:chiricos,项目名称:blog-con-laravel,代码行数:13,代码来源:UsersController.php

示例10: update

 /**
  * Update the specified resource in storage.
  *
  * @param UserRequest $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(UserRequest $request, $id)
 {
     $user = \App\User::findOrFail($id);
     $user->fill($request->only('name', 'email'));
     $user->save();
     return $user;
 }
开发者ID:laravelmtl,项目名称:api,代码行数:14,代码来源:UserController.php

示例11: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\UserRequest  $request
  * @return \Illuminate\Http\Response
  */
 public function update(UserRequest $request)
 {
     $user = \Auth::user();
     $user->update($request->all());
     \Flash::success('登録情報を更新しました。');
     return redirect('user');
 }
开发者ID:kittaka1222takashi,项目名称:dokoiko,代码行数:13,代码来源:UsersController.php

示例12: postLogin

 protected function postLogin(UserRequest $request)
 {
     if (Auth::attempt($request->only('email', 'password'), $request->has('remember_me'))) {
         return Redirect::intended();
     }
     return Redirect::route('login')->withInput($request->only('email', 'remember_me'))->withErrors(['email' => Lang::get('auth.email_error_login')]);
 }
开发者ID:Marco3d,项目名称:alpha,代码行数:7,代码来源:AuthController.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(UserRequest $request)
 {
     $user = new User($request->all());
     $user->password = bcrypt($request->password);
     $user->save();
     return redirect()->route('admin.users.index');
     Flash::success("El usuario se ha creado correctamente.");
 }
开发者ID:eloyespeche,项目名称:BlogLaravelFinal,代码行数:14,代码来源:UsersController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(UserRequest $request)
 {
     $user = User::create($request->all());
     $user->password = bcrypt($request->password);
     $user->save();
     Session::flash('message_create', "El usuario - " . $request->name . " - fue creado exitosamente!");
     return redirect()->route('admin.users.index');
 }
开发者ID:JhonatanC,项目名称:laravelcodfa,代码行数:14,代码来源:UsersController.php

示例15: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(UserRequest $request, $id)
 {
     $user = User::findOrFail($id);
     $user->update($request->all());
     $this->syncRoles($user, $request->input('role_list'));
     flash()->success('Success!', 'User updated successfully!');
     return redirect('users');
 }
开发者ID:amolkattel,项目名称:Asset-Mgnt-Project,代码行数:15,代码来源:UsersController.php


注:本文中的App\Http\Requests\UserRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。