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


PHP Auth::provider方法代码示例

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


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

示例1: boot

 /**
  * Boot Oci8 Provider
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/../config/oracle.php' => config_path('oracle.php')], 'oracle');
     Auth::provider('oracle', function ($app, array $config) {
         return new OracleUserProvider($app['hash'], $config['model']);
     });
 }
开发者ID:yajra,项目名称:laravel-oci8,代码行数:10,代码来源:Oci8ServiceProvider.php

示例2: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/config/ldap.php' => config_path('ldap.php')]);
     Auth::provider('ldap', function ($app, array $config) {
         return new LdapAuthUserProvider($app['hash'], $config['model']);
     });
 }
开发者ID:xavrsl,项目名称:ldap,代码行数:12,代码来源:LdapServiceProvider.php

示例3: boot

 /**
  * Register any application authentication / authorization services.
  *
  * @param  \Illuminate\Contracts\Auth\Access\Gate  $gate
  * @return void
  */
 public function boot(GateContract $gate)
 {
     Auth::provider('riak', function ($app, array $config) {
         // Return an instance of Illuminate\Contracts\Auth\UserProvider...
         return new RiakUserProvider();
     });
 }
开发者ID:fednep,项目名称:LaravelAuthProviderIssue,代码行数:13,代码来源:AuthServiceProvider.php

示例4: registerHelpers

 /**
  * Register the helpers file.
  */
 public function registerHelpers()
 {
     require __DIR__ . '/helpers.php';
     Auth::provider('one-auth', function ($app, array $config) {
         $userRepository = App::make(UserRepository::class);
         return new OneAuthUserProvider($userRepository);
     });
     $this->publishes([__DIR__ . '/../config/config.php' => config_path('one-auth.php')]);
 }
开发者ID:hrmshandy,项目名称:OneAuth,代码行数:12,代码来源:OneAuthServiceProvider.php

示例5: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     // Register 'ldap' as authentication method
     Auth::provider('ldap', function ($app) {
         // Create new LDAP connection based on configuration files
         $ldap = new Ldap($this->getLdapConfig());
         return new LdapAuthUserProvider($ldap, $app['config']['auth']['providers']['ldap-users']['model']);
     });
 }
开发者ID:hbalagtas,项目名称:ldap-auth,代码行数:14,代码来源:LdapAuthServiceProvider.php

示例6: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Register 'ldap' as authentication method
     Auth::provider('ldap', function ($app) {
         $model = $app['config']['auth']['providers']['ldap-users']['model'];
         // Create a new LDAP connection
         $connection = new Ldap($this->getLdapConfig());
         return new LdapAuthUserProvider($connection, $model);
     });
 }
开发者ID:krenor,项目名称:ldap-auth,代码行数:15,代码来源:LdapAuthServiceProvider.php

示例7: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     Auth::provider('neo4j', function () {
         // Return an instance of Illuminate\Contracts\Auth\UserProvider...
         return new Neo4jUserProvider();
     });
     Validator::extend('jsonMax', function ($attribute, $value, $parameters, $validator) {
         return count(json_decode($value)) <= array_shift($parameters);
     });
 }
开发者ID:weopendata,项目名称:medea,代码行数:15,代码来源:AppServiceProvider.php

示例8: boot

 /**
  * Run service provider boot operations.
  *
  * @return void
  */
 public function boot()
 {
     $auth = __DIR__ . '/Config/auth.php';
     // Add publishable configuration.
     $this->publishes([$auth => config_path('adldap_auth.php')], 'adldap');
     $this->mergeConfigFrom($auth, 'adldap_auth');
     // Register the adldap auth user provider.
     Auth::provider('adldap', function ($app, array $config) {
         return new AdldapAuthUserProvider($app['hash'], $config['model']);
     });
 }
开发者ID:ProyectoSanClemente,项目名称:proyectoapi,代码行数:16,代码来源:AdldapAuthServiceProvider.php

示例9: setupParse

 /**
  * Setup parse.
  *
  * @return void
  */
 protected function setupParse()
 {
     $config = $this->app->config->get('parse');
     ParseClient::setStorage(new SessionStorage());
     ParseClient::initialize($config['app_id'], $config['rest_key'], $config['master_key']);
     ParseClient::setServerURL($config['server_url'], $config['mount_path']);
     Auth::provider('parse', function ($app, array $config) {
         return new UserProvider($config['model']);
     });
     Auth::provider('parse-facebook', function ($app, array $config) {
         return new FacebookUserProvider($config['model']);
     });
     Auth::provider('parse-any', function ($app, array $config) {
         return new AnyUserProvider($config['model']);
     });
 }
开发者ID:parziphal,项目名称:parse,代码行数:21,代码来源:ParseServiceProvider.php

示例10: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     // Publish configuration
     $this->publishes([__DIR__ . '/../../config/contactable.php' => config_path('contactable.php')], 'config');
     // Publish migrations
     $this->publishes([__DIR__ . '/../Migrations/' => database_path('migrations')], 'migrations');
     // Load views
     $this->loadViewsFrom(__DIR__ . '/../../resources/views/', 'contactable');
     // Bind the authentication provider
     app()->bind('ContactableAuthProvider', function () {
         return new ContactableAuthProvider(app('hash'), config('auth.providers.users.model', \App\User::class));
     });
     // Add authentication driver
     Auth::provider('contactable', function ($app) {
         // Return an instance of Illuminate\Contracts\Auth\UserProvider...
         return $app->make('ContactableAuthProvider');
     });
 }
开发者ID:gridprinciples,项目名称:contactable,代码行数:23,代码来源:ContactableServiceProvider.php


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