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


PHP Auth::createUserProvider方法代码示例

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


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

示例1: boot

 /**
  * Register any application authentication / authorization services.
  *
  * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
  * @return void
  */
 public function boot(GateContract $gate)
 {
     $this->registerPolicies($gate);
     Auth::extend('api_token', function ($app, $name, array $config) {
         return new ApiTokenGuard(Auth::createUserProvider($config['provider']), $this->app['request']);
     });
 }
开发者ID:hoangnd25,项目名称:laravel-boilerplate,代码行数:13,代码来源:AuthServiceProvider.php

示例2: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     Auth::extend('iget-token', function ($app, $name, array $config) {
         $guard = new TokenGuard(Auth::createUserProvider($config['provider']), $app['request']);
         $app->refresh('request', $guard, 'setRequest');
         return $guard;
     });
 }
开发者ID:iget-master,项目名称:token-auth,代码行数:13,代码来源:TokenAuthServiceProvider.php

示例3: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot(GateContract $gate)
 {
     $this->registerPolicies($gate);
     Auth::extend('auth-token', function ($app, $name, array $config) {
         return new TokenGuard(Auth::createUserProvider($config['provider']), $app['request']);
     });
     $this->publishes([__DIR__ . '/../config/api.php' => config_path('api.php')], 'config');
     $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations');
     if (!$this->app->routesAreCached()) {
         require __DIR__ . '/Http/routes.php';
     }
 }
开发者ID:iget-master,项目名称:api-base,代码行数:17,代码来源:ApiBaseServiceProvider.php

示例4: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     Auth::extend('oauth', function ($app, $name, array $config) {
         return new OAuthGuard(Auth::createUserProvider($config['provider']), $this->app['request']);
     });
 }
开发者ID:everywell,项目名称:laravel-essentials,代码行数:11,代码来源:AuthServiceProvider.php


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