本文整理汇总了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']);
});
}
示例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']);
});
}
示例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();
});
}
示例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')]);
}
示例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']);
});
}
示例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);
});
}
示例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);
});
}
示例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']);
});
}
示例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']);
});
}
示例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');
});
}