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