当前位置: 首页>>代码示例>>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;未经允许,请勿转载。