當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::extend方法代碼示例

本文整理匯總了PHP中Auth::extend方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::extend方法的具體用法?PHP Auth::extend怎麽用?PHP Auth::extend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Auth的用法示例。


在下文中一共展示了Auth::extend方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: laravel_init

 public static function laravel_init()
 {
     // Load AutoLoad Aliases
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\LaravelAuth', 'LaravelAuth');
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\Me', 'Me');
     // Extend the Laravel Auth library to use our own custom driver.
     \Auth::extend('cloudmanic_auth', function () {
         return new LaravelAuth();
     });
     // Set Api auth filter.
     \Laravel\Routing\Route::filter('api_auth', function () {
         return CloudAuth::sessioninit();
     });
     // Build a micro for activating a class or not. We use this in a main navigation
     // to set the html class to active or not.
     \Laravel\HTML::macro('is_active', function ($name, $home = false, $class = 'active') {
         $base = \Laravel\URI::segment(1);
         // Is the the default route?
         if ($home && empty($base)) {
             return $class;
         }
         // Compare the segment.
         if ($base == $name) {
             return $class;
         }
         return '';
     });
 }
開發者ID:cloudmanic,項目名稱:php-warchest,代碼行數:28,代碼來源:Start.php

示例2: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('glokon/crowd-auth');
     \Auth::extend('crowd-auth', function () {
         return new \Illuminate\Auth\Guard(new \GLOKON\CrowdAuth\CrowdAuthUserProvider(), \App::make('session.store'));
     });
 }
開發者ID:glokon,項目名稱:crowd-auth,代碼行數:12,代碼來源:CrowdAuthServiceProvider.php

示例3: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('t3chnik/verify-l4-mongolid');
     \Auth::extend('verify', function () {
         return new Guard(new VerifyUserProvider(new BcryptHasher(), \Config::get('auth.model')), \App::make('session'));
     });
 }
開發者ID:t3chnik,項目名稱:verify-l4-mongolid,代碼行數:12,代碼來源:Verifyl4MongolidServiceProvider.php

示例4: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('djbarnes/l4-ldap-auth');
     \Auth::extend('l4-ldap-auth', function () {
         return new Guard(new L4LdapAuthUserProvider(\Config::get('l4-ldap-auth::ldapserver'), \Config::get('l4-ldap-auth::ldapadmindn'), \Config::get('l4-ldap-auth::ldapadminpw'), \Config::get('l4-ldap-auth::searchbase'), \Config::get('l4-ldap-auth::searchfield')), \App::make('session'));
     });
 }
開發者ID:p-tricky,項目名稱:l4-ldap-auth,代碼行數:12,代碼來源:L4LdapAuthServiceProvider.php

示例5: boot

 public function boot()
 {
     \Auth::extend('taketwo', function ($app) {
         $provider = new TaketwoUserProvider($app['hash']);
         return new Guard($provider, $app['session.store']);
     });
 }
開發者ID:zerozh,項目名稱:taketwouser,代碼行數:7,代碼來源:AuthServiceProvider.php

示例6: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('ehtasham89/laravel-apiauth-driver');
     \Auth::extend('lvapiauth', function () {
         return new Guard(new Providers\LvApiAuthUserProvider(), \App::make('session.store'));
     });
 }
開發者ID:ehtasham89,項目名稱:laravel-apiauth-driver,代碼行數:12,代碼來源:LvApiAuthServiceProvider.php

示例7: boot

 public function boot()
 {
     \Auth::extend('tracker_driver', function () {
         $model = \Config::get('auth.model');
         $provider = new EloquentUserProvider(\App::make('hash'), $model);
         return new TrackerGuard($provider, \App::make('session.store'));
     });
 }
開發者ID:SlipperyPenguine,項目名稱:tracker,代碼行數:8,代碼來源:TrackerAuth.php

示例8: boot

 /**
  * Boot the service provider.
  */
 public function boot()
 {
     \Auth::extend('sysguard', function ($app) {
         return new EloquentUserProvider($app['hash'], $app['config']['auth.model']);
     });
     $this->publishes([__DIR__ . '/migrations/' => $this->app->databasePath() . '/migrations'], 'migrations');
     $this->loadViewsFrom(__DIR__ . '/views', 'sysguard');
 }
開發者ID:ifaniqbal,項目名稱:sysguard,代碼行數:11,代碼來源:SysguardServiceProvider.php

示例9: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('lucor/laravel-auth-file-driver');
     \Auth::extend('file', function ($app) {
         $users = \Config::get('laravel-auth-file-driver::users');
         return new Guard(new FileUserProvider($users, $app['hash'], $app['cache']), $app['session.store']);
     });
 }
開發者ID:lucor,項目名稱:laravel-auth-file-driver,代碼行數:13,代碼來源:AuthServiceProvider.php

示例10: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('canaan5/power');
     \Auth::extend('power', function () {
         return new Guard(new PowerUserProvider(new BcryptHasher(), \Config::get('auth.model', 'User')), \App::make('session.store'));
     });
     // $this->exceptionMessages();
 }
開發者ID:canaan5,項目名稱:power,代碼行數:13,代碼來源:PowerServiceProvider.php

示例11: boot

 /**
  * Bootstrap the application events.
  */
 public function boot()
 {
     //Registers the new Auth Provider
     \Auth::extend('multilogin', function ($app) {
         return new MultisourceDriver(SourceFactory::generateConfiguration());
     });
     //Enables the config copy from the Base Config File
     $this->publishes([__DIR__ . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR . 'multisource.php' => config_path('multisource.php')]);
 }
開發者ID:AndresRojasIsaza,項目名稱:Multisource,代碼行數:12,代碼來源:MultisourceServiceProvider.php

示例12: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/../../config/permiso.php' => config_path('permiso.php')]);
     \Auth::extend('permiso', function () {
         $model = \Config::get('auth.model');
         $provider = new \Illuminate\Auth\EloquentUserProvider(\App::make('hash'), $model);
         return new PermisoGuard($provider, \App::make('session.store'));
     });
     $this->commands('command.permiso.migration');
 }
開發者ID:ricardoriogo,項目名稱:permiso,代碼行數:15,代碼來源:PermisoServiceProvider.php

示例13: boot

 public function boot()
 {
     $this->publishes([__DIR__ . '/../../config/verify.php' => config_path('verify.php')], 'config');
     $this->mergeConfigFrom(__DIR__ . '/../../config/verify.php', 'verify');
     $this->publishes([__DIR__ . '/../../database/migrations/' => base_path('database/migrations')], 'migrations');
     $this->publishes([__DIR__ . '/../../database/seeds/' => base_path('database/seeds')], 'seeds');
     \Auth::extend('verify', function ($app) {
         return new VerifyGuard(new VerifyUserProvider($app['hash'], $app['config']['auth.model']), $app['session.store']);
     });
 }
開發者ID:snowket,項目名稱:translate-with-laravel-admin-panel,代碼行數:10,代碼來源:VerifyServiceProvider.php

示例14: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/config/auth.php' => config_path('auth.php'), __DIR__ . '/config/auth.routes.php' => config_path('auth.routes.php')]);
     $this->loadTranslationsFrom(__DIR__ . '/lang', 'identify');
     $this->loadViewsFrom(__DIR__ . '/views', 'identify');
     \Auth::extend('session', function ($app, $name, array $config) {
         $model = $app['config']['auth.providers.users.model'];
         $provider = new IdentifyUserProvider($app['hash'], $model);
         return new Identify($name, $provider, $this->app['session.store'], $this->app['request']);
     });
 }
開發者ID:GDanielRG,項目名稱:Identify,代碼行數:16,代碼來源:IdentifyServiceProvider.php

示例15: boot

 public function boot()
 {
     $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'Kaamaru\\Forums');
     \Validator::resolver(function ($translator, $data, $rules, $messages) {
         return new ValidationRules($translator, $data, $rules, $messages);
     });
     \Auth::extend('eloquent', function ($app) {
         $model = $this->app['config']['auth.model'];
         return new EloquentUserProvider($this->app['hash'], $model);
     });
     require __DIR__ . '/Http/breadcrumbs.php';
 }
開發者ID:kaamaru,項目名稱:laravel-forums,代碼行數:12,代碼來源:ForumsServiceProvider.php


注:本文中的Auth::extend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。