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


PHP UserRequest::session方法代码示例

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


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

示例1: login

 public function login(UserRequest $request)
 {
     $credentials = array('name' => $request->get('name'), 'password' => $request->get('password'));
     if ($this->auth->attempt($credentials)) {
         $request->session()->flash('success', 'You are now logged in!');
     }
     return redirect('/');
 }
开发者ID:playatech,项目名称:laravel-voldb,代码行数:8,代码来源:UserController.php

示例2: saveUser

 public function saveUser(UserRequest $request)
 {
     DB::beginTransaction();
     try {
         $this->userRepository->create($request->all());
         DB::commit();
         $request->session()->flash('message-success', 'Usuário criado com sucesso!');
         return redirect()->route('user.create');
     } catch (ValidationException $e) {
         DB::rollback();
         return Redirect::back()->withErrors($e->getErrors())->withInput();
     } catch (\Exception $e) {
         DB::rollback();
         throw $e;
     }
 }
开发者ID:valentimaraujo,项目名称:uplexis,代码行数:16,代码来源:UserController.php

示例3: 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');
         }
     }
 }
开发者ID:riz1,项目名称:blog-ahsan,代码行数:24,代码来源:UserController.php

示例4: changePassword

 public function changePassword(UserRequest $request, $token)
 {
     $input = $request->all();
     $yesterday = date('Y-m-d H:i:s', strtotime("24 hours ago"));
     // Only select matching tokens from the past day
     $user = User::where('reset_token', $token)->where('reset_time', '>=', $yesterday)->first();
     if (!$user) {
         $request->session()->flash('error', 'Invalid reset code. It may have expired.');
         return redirect('/forgot');
     }
     $user->password = bcrypt($input['password']);
     $user->save();
     $request->session()->flash('success', 'Your password has been reset, you may now log in.');
     return redirect('/login');
 }
开发者ID:playatech,项目名称:weightlifter,代码行数:15,代码来源:UserController.php


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