本文整理汇总了PHP中App\Http\Requests\UserRequest::input方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRequest::input方法的具体用法?PHP UserRequest::input怎么用?PHP UserRequest::input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Requests\UserRequest
的用法示例。
在下文中一共展示了UserRequest::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');*/
}
示例2: postForm
public function postForm(UserRequest $request, User $user)
{
$user->first_name = $request->input('first_name');
$user->last_name = $request->input('last_name');
$user->email = $request->input('email');
$user->password = $request->input('password');
$user->save();
return view('account/account_ok');
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param User $user
* @return \Illuminate\Http\Response
*/
public function update(UserRequest $request, User $user)
{
$user->update($request->only(['name', 'occupation', 'bio', 'email']));
$files_id[] = $request->hasFile('photo') ? $this->uploadFile($user, $request->file('photo'), 'profile_photo') : $request->input('photo_id');
$files_id[] = $request->hasFile('cover') ? $this->uploadFile($user, $request->file('cover'), 'profile_cover') : $request->input('cover_id');
$user->files()->sync($files_id);
session()->flash('flash_message', 'Se han actualizado los datos de perfil');
return redirect('admin/settings?tab=profile');
}
示例4: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(UserRequest $request)
{
$request['password'] = \Hash::make($request->input('password'));
$request['role'] = $request->input('role');
//dd($request);
User::create($request->all());
\Flash::success('New user has been added.');
return redirect()->route('admin.users.index');
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(UserRequest $request, $id)
{
//dd($request->input('password') == '');
$user = User::find($id);
$user->role_id = $request->input('role_id');
$user->name = $request->input('name');
$user->employee_no = $request->input('employee_no');
if ($request->input('password') != '') {
$user->password = bcrypt($request->input('password'));
}
$user->save();
return redirect('users');
}
示例6: store
public function store(UserRequest $request)
{
$imageName = $user->id . '.' . $request->file('photo')->getClientOriginalExtension();
$user = new Users(array('name' => $request->input('name'), 'email' => $request->input('email'), 'password' => bcrypt($request->input('password')), 'image' => $imageName, 'role' => $request->input('role')));
$user->save();
/*DB::table('users')->where('id', $user->id)->update(
['image' => $imageName]);*/
$request->file('photo')->move(base_path() . '/public/images/', $imageName);
//$input = $request->all();
//Users::create($input);
/*DB::table('users')->insertGetId(
['name' => $request->input('name'), 'email' => $request->input('email'), 'password' => bcrypt($request->input('password')), 'role' => $request->input('role')
]);*/
return redirect('user');
}
示例7: 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');
}
示例8: 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');
}
示例9: postReset
/**
* Save the new Password (finish the password reset lifecicly)
*
* @return void
*/
public function postReset($user_email, $password_reset_token, UserRequest $request)
{
$user = App::make('password_reset_user');
$user->password = $request->input('password');
$user->save();
Auth::login($user);
return Redirect::route('frontpage')->with('alert.success', Lang::get('auth.password_reset_success_alert'));
}
示例10: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(UserRequest $request)
{
if (isset($_POST['yes'])) {
$user = new User();
//$this->validate($request,['user_name' => 'required','user_pass' => 'required']);
$user->username = $request->input('user_name');
$user->password = $request->input('user_pass');
$userdata = array('username' => $user->username, 'password' => $user->password);
if (Auth::attempt($userdata)) {
$posts = Post::all();
return view('post.index', ['posts' => $posts]);
} else {
$request->session()->flash('alert-danger', 'Please Check username and password');
return redirect('/');
//return view ('login.index');
}
}
}
示例11: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Requests\UserRequest $request)
{
$newUser = User::create(['username' => $request->input('username'), 'password' => Hash::make($request->input('password')), 'fullname' => $request->input('fullname'), 'customer' => Auth::user()->customer, 'email' => $request->input('email'), 'permlevel' => $request->input('permlevel'), 'vmenabled' => $request->input('enable_voicemail')]);
UserSettings::create(['user' => $newUser->id]);
$newPeer = Peer::create(['name' => Auth::user()->customer . '_' . $newUser->id, 'callerid' => Auth::user()->Customer->default_callerid, 'defaultuser' => Auth::user()->customer . '_' . $newUser->id, 'secret' => Peer::genSecret(), 'mailbox' => $newUser->id . '@' . Auth::user()->customer, 'portaluid' => $newUser->id]);
$newUser->peer = $newPeer->id;
$newUser->save();
$blfText = file_get_contents(env('EXTENSIONS_CONF_FILE_PATH'));
$blfText = str_replace("[BLF]\n", "[BLF]\nexten => " . $newPeer->getHint() . ",hint,SIP/" . $newPeer->name . "\n", $blfText);
file_put_contents(env('EXTENSIONS_CONF_FILE_PATH'), $blfText);
$newMailbox = VoicemailBox::create(['customer_id' => $newUser->id, 'context' => $newUser->customer, 'mailbox' => $newUser->id, 'password' => $request->input('vmpassword'), 'fullname' => $newUser->fullname, 'email' => $newUser->email, 'sip_buddy_id' => $newPeer->id, 'attach' => $request->input('enable_email'), 'delete' => $request->input('enable_email')]);
$newPeer->vmrow = $newMailbox->uniqueid;
$newPeer->save();
return redirect('/user');
}
示例12: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update(UserRequest $request, $id)
{
$input = $request->all();
if (isset($input['password'])) {
if ($request->input('password') != $request->input('password2')) {
return redirect()->back()->with('warning', 'your passwords did not match')->withInput();
}
}
$user = User::find($id);
$user->email = $input['email'];
$user->name = $input['name'];
$user->client_id = $input['client_id'];
$user->is_admin = $request->input('is_admin') ?: false;
if (isset($input['password'])) {
$user->password = bcrypt($input['password']);
}
$user->save();
return redirect()->route('admin.users.index')->with('message', "{$user->email} successfully edited");
}
示例13: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($domain, $id, UserRequest $request)
{
$userService = new userService();
if ($request->isMethod('POST')) {
$name = $request->input('name');
$email = $request->input('email');
$phone = $request->input('phone');
$role = $request->input('role');
$password = $request->input('password');
$dataUser = ['name' => $name, 'email' => $email, 'phone' => $phone, 'role' => $role];
if ($password) {
$password = Hash::make(md5($password));
array_add($dataUser, 'password', $password);
}
$userService->updateItem($id, $dataUser);
}
$user = $userService->getUserById($id);
return view('admin.user.edit', array('item' => $user));
}
示例14: simpanuser
public function simpanuser(UserRequest $request)
{
$input = $request->all();
$input['password'] = bcrypt($request->input('password'));
try {
User::create($input);
} catch (QueryException $e) {
return redirect()->route('admin::tambah_user')->with('pesan', 'Username yang anda masukkan sudah ada dalam database.');
}
return redirect()->route('admin::user')->with('message', 'User baru telah ditambahkan...');
}
示例15: update
public function update($id, UserRequest $request)
{
$user = User::findOrFail($id);
$user->username = $request->input('username');
$user->email = $request->input('email');
$user->password = bcrypt($request->input('password'));
$user->name_en = $request->input('name_en');
$user->name_bn = $request->input('name_bn');
$user->user_group_id = $request->input('user_group_id');
$user->workspace_id = $request->input('workspace_id');
$user->status = $request->input('status');
$user->updated_by = Auth::user()->id;
$user->updated_at = time();
$user->update();
Session()->flash('flash_message', 'User has been updated!');
return redirect('users');
}