本文整理汇总了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 '';
});
}
示例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'));
});
}
示例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'));
});
}
示例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'));
});
}
示例5: boot
public function boot()
{
\Auth::extend('taketwo', function ($app) {
$provider = new TaketwoUserProvider($app['hash']);
return new Guard($provider, $app['session.store']);
});
}
示例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'));
});
}
示例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'));
});
}
示例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');
}
示例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']);
});
}
示例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();
}
示例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')]);
}
示例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');
}
示例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']);
});
}
示例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']);
});
}
示例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';
}