当前位置: 首页>>代码示例>>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;未经允许,请勿转载。