當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Redirect::intended方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Redirect::intended方法的典型用法代碼示例。如果您正苦於以下問題:PHP Redirect::intended方法的具體用法?PHP Redirect::intended怎麽用?PHP Redirect::intended使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Redirect的用法示例。


在下文中一共展示了Redirect::intended方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postLogin

 /**
  * @param Request $request
  *
  * @return mixed
  */
 public function postLogin(Request $request)
 {
     $credentials = $request->only(['username', 'password']);
     $validator = Validator::make($credentials, ['username' => 'required', 'password' => 'required']);
     if ($validator->fails()) {
         return Redirect::back()->withInput()->withErrors($validator);
     }
     if (Auth::guard('admin')->attempt($credentials)) {
         return Redirect::intended(config('admin.prefix'));
     }
     return Redirect::back()->withInput()->withErrors(['username' => $this->getFailedLoginMessage()]);
 }
開發者ID:z-song,項目名稱:laravel-admin,代碼行數:17,代碼來源:AuthController.php

示例2: postLogin

 public function postLogin()
 {
     $input = Input::all();
     $attempt = Auth::attempt(array('email' => $input['email'], 'password' => $input['password'], 'confirmed' => 1));
     if ($attempt) {
         if (Request::ajax()) {
             return Response::json(array('user' => Auth::user()));
         } else {
             return Redirect::intended('home');
         }
     } else {
         //Attempt again without checking 'confirmed'
         $attempt = Auth::validate(array('email' => $input['email'], 'password' => $input['password']));
         if ($attempt) {
             //Credentials are correct. but email not verified
             $error = __('emailNotConfirmedYet');
             $emailNotConfirmed = true;
         } else {
             $error = __('emailOrPasswordIncorrect');
         }
         if (Request::ajax()) {
             return Response::json(array('error' => $error, 'emailNotConfirmed' => !empty($emailNotConfirmed) ? true : false), 400);
         } else {
             return Redirect::to(route('login'))->with('login:errors', [$error])->withInput();
         }
     }
 }
開發者ID:ramialcheikh,項目名稱:onepathnetwork,代碼行數:27,代碼來源:UserController.php

示例3: register

 public function register()
 {
     if (Request::isMethod('post')) {
         User::create(['name' => Request::get('name'), 'email' => Request::get('email'), 'password' => bcrypt(Request::get('password'))]);
     }
     return Redirect::intended('/');
 }
開發者ID:jerryhanks,項目名稱:Melport,代碼行數:7,代碼來源:Front.php

示例4: postLogin

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postLogin(Request $request)
 {
     $input = $request->only('email', 'password', 'type');
     $remember = $request->get('rememberme');
     try {
         // Authenticate the user
         $user = User::authenticate($input, $remember);
         return Redirect::intended('/admin');
     } catch (\Lavalite\user\Exceptions\LoginRequiredException $e) {
         $result = 'Login field is required.';
     } catch (\Lavalite\user\Exceptions\PasswordRequiredException $e) {
         $result = 'Password field is required.';
     } catch (\Lavalite\user\Exceptions\WrongPasswordException $e) {
         $result = 'Wrong password, try again.';
     } catch (\Lavalite\user\Exceptions\UserNotFoundException $e) {
         $result = $e->getMessage();
         //'User was not found.';
     } catch (\Lavalite\user\Exceptions\UserNotActivatedException $e) {
         $result = 'User is not activated.';
     } catch (\Lavalite\user\Exceptions\UserSuspendedException $e) {
         $result = 'User is suspended.';
     } catch (\Lavalite\user\Exceptions\UserBannedException $e) {
         $result = 'User is banned.';
     }
     Session::flash('error', $result);
     return Redirect::to('admin/login')->withInput();
 }
開發者ID:samarthsave,項目名稱:cms,代碼行數:32,代碼來源:AdminController.php

示例5: login

 protected function login()
 {
     if (auth()->attempt(array('email' => Input::get('email'), 'password' => Input::get('password')), true) || auth()->attempt(array('name' => Input::get('email'), 'password' => Input::get('password')), true)) {
         return Redirect::intended('/');
     }
     return back()->withInput()->with('message', 'Неверное имя пользователя и/или пароль!');
 }
開發者ID:Anatoly38,項目名稱:proj01.laravel,代碼行數:7,代碼來源:AuthController.php

示例6: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, ...$roles)
 {
     if (!$this->user->hasRole($roles)) {
         return Redirect::intended('/users/members');
     }
     return $next($request);
 }
開發者ID:jtoshmat,項目名稱:laravel,代碼行數:14,代碼來源:Role.php

示例7: postLogin

 /**
  * Logs the user in.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postLogin()
 {
     if (Auth::attempt(Binput::only(['email', 'password']))) {
         return Redirect::intended('dashboard');
     }
     Throttle::hit(Request::instance(), 10, 10);
     return Redirect::back()->withInput(Binput::except('password'))->with('error', 'Invalid email or password');
 }
開發者ID:baa-archieve,項目名稱:Cachet,代碼行數:13,代碼來源:AuthController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('email', 'password');
     if (Auth::attempt($input)) {
         return Redirect::intended('/profile');
     }
     return Redirect::back()->withFlashMessage('E-mail Address and/or Password incorrect');
 }
開發者ID:raymondidema,項目名稱:user-package,代碼行數:13,代碼來源:SessionController.php

示例9: save

 public function save($slug, Request $request)
 {
     if (Auth::check() && Auth::user()->id == Page::slug($slug)->user->id) {
         $page = Page::slug($slug);
         $page->content = $request->content;
         $page->save();
     }
     return Redirect::intended('/page/' . $slug);
 }
開發者ID:AndrewPMarks,項目名稱:blog,代碼行數:9,代碼來源:PageController.php

示例10: postLogin

 public function postLogin()
 {
     $data['email'] = Input::get('email');
     $data['password'] = Input::get('password');
     if (Auth::attempt($data, Input::get('remember'))) {
         return Redirect::intended('/');
     }
     return Redirect::to('account/login')->with('errors', 'Datos incorrectos');
 }
開發者ID:hanabalonch,項目名稱:pronueva_back,代碼行數:9,代碼來源:AuthController.php

示例11: doLogin

 /**
  * Função para login no sistema. Os parâmetros (login e senha) são passados por POST
  *
  * @return mixed
  */
 public function doLogin()
 {
     try {
         Auth::attempt(array('cpf' => Input::get('login'), 'senha' => Input::get('senha')));
         return Redirect::intended('/');
     } catch (Exception $e) {
         return Redirect::to('login')->withErrors($e->getMessage())->withInput();
     }
 }
開發者ID:vlamirc,項目名稱:arquetipophp,代碼行數:14,代碼來源:LoginController.php

示例12: postReauthenticate

 /**
  * Handle the reauthentication request to the application.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function postReauthenticate(Request $request)
 {
     $this->validate($request, ['password' => 'required']);
     $reauth = new ReauthLimiter($request);
     if (!$reauth->attempt($request->password)) {
         return Redirect::back()->withErrors(['password' => $this->getFailedLoginMessage()]);
     }
     return Redirect::intended();
 }
開發者ID:mpociot,項目名稱:reauthenticate,代碼行數:16,代碼來源:Reauthenticates.php

示例13: postReauthenticate

 /**
  * Handle the reauthentication request to the application.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function postReauthenticate(Request $request)
 {
     $this->validate($request, ['password' => 'required']);
     if (!Hash::check($request->password, Auth::user()->getAuthPassword())) {
         return Redirect::back()->withErrors(['password' => $this->getFailedLoginMessage()]);
     }
     $request->session()->set('reauthenticate.life', Carbon::now()->timestamp);
     $request->session()->set('reauthenticate.authenticated', true);
     return Redirect::intended();
 }
開發者ID:Evolteck,項目名稱:reauthenticate,代碼行數:17,代碼來源:Reauthenticates.php

示例14: login

 public function login()
 {
     $title = Lang::get('auth::login.title');
     if (Request::isMethod('POST')) {
         if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password'), 'activated' => 1, 'suspended' => 0), Input::has('remember'))) {
             return Redirect::intended(Config::get('auth::login.redirect'));
         }
         return Redirect::back()->with('attempt', false)->withInput();
     }
     return View::make(Config::get('auth::login.view'), compact('title'));
 }
開發者ID:larrytech,項目名稱:auth,代碼行數:11,代碼來源:AuthController.php

示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $formData = Input::only('email', 'password');
     $this->signInForm->validate($formData);
     if (!Auth::attempt($formData)) {
         Flash::message('We were unable to sign you in. Please check your credentials.');
         return Redirect::back()->withInput();
     }
     Flash::message('Welcome Back!');
     return Redirect::intended('statuses');
 }
開發者ID:itsSkyler,項目名稱:larabook,代碼行數:16,代碼來源:SessionsController.php


注:本文中的Illuminate\Support\Facades\Redirect::intended方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。