當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。