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


PHP PasswordBroker::validator方法代码示例

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


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

示例1: validator

 /**
  * Set a custom password validator.
  *
  * @param \Closure $callback
  * @return void 
  * @static 
  */
 public static function validator($callback)
 {
     \Illuminate\Auth\Passwords\PasswordBroker::validator($callback);
 }
开发者ID:tvad911,项目名称:biquyetmuasam.com,代码行数:11,代码来源:_ide_helper.php

示例2: registerPasswordBroker

 /**
  * Register the password broker instance.
  *
  * @return void
  */
 protected function registerPasswordBroker()
 {
     $this->app->singleton('auth.password', function ($app) {
         // The password token repository is responsible for storing the email addresses
         // and password reset tokens. It will be used to verify the tokens are valid
         // for the given e-mail addresses. We will resolve an implementation here.
         $tokens = $app['auth.password.tokens'];
         $users = $app['auth']->driver()->getProvider();
         $view = $app['config']['auth.password.email'];
         // The password broker uses a token repository to validate tokens and send user
         // password e-mails, as well as validating that password reset process as an
         // aggregate service of sorts providing a convenient interface for resets.
         $broker = new PasswordBroker($tokens, $users, $app['mailer'], $view);
         // register validator for password
         $broker->validator(function ($credentials) {
             try {
                 return app('xe.user')->validatePassword($credentials['password']);
             } catch (\Exception $e) {
                 return false;
             }
         });
         return $broker;
     });
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:29,代码来源:UserServiceProvider.php


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