當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。