本文整理汇总了PHP中App\Http\Requests\UserRequest::all方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRequest::all方法的具体用法?PHP UserRequest::all怎么用?PHP UserRequest::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Requests\UserRequest
的用法示例。
在下文中一共展示了UserRequest::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: store
public function store(Requests\UserRequest $request)
{
$input = $request->all();
$input['password'] = bcrypt($input['password']);
User::create($input);
return redirect(url('admin/user'));
}
示例3: 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');
}
示例4: 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');
}
示例5: 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');
}
示例6: 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();
}
示例7: 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 . '');
}
示例8: store
/**
* 存储新用户
*
* @param UserRequest $request
* @return Response
*/
public function store(UserRequest $request)
{
$this->user->fill($request->all());
$this->user->score = max(60, OldUser::where('openid', $this->user->openid)->first()->score);
$this->user->save();
return redirect()->action('RegisterController@index');
}
示例9: 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');
}
示例10: 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');
}
示例11: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id, UserRequest $request)
{
$user = User::findOrFail($id);
$user->fill($request->all())->save();
$user->roles()->sync($request->input('role_list'));
flash()->success('User Updated.');
return redirect('user');
}
示例12: store
/**
* Store a newly created resource in storage.
*
* @param UserRequest $request
* @return Response
*/
public function store(UserRequest $request)
{
$user = new User();
$request['password'] = bcrypt($request->get('password'));
$user = $user->create($request->all());
$user->roles()->sync(collect($request->get('role'))->all());
return redirect()->route('user.manager.index');
}
示例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.");
}
示例14: 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();
Flash::success('Se ha registrado a ' . $user->name . ' correctamente.');
return redirect()->route('admin.users.index');
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(UserRequest $request)
{
$input = $request->all();
$input['password'] = bcrypt($input['password']);
if (User::create($input)) {
return redirect('/users');
}
}