public function boot() { Auth::extend('ExpressionEngineAuth', function ($app) { $model = $this->app['config']['auth.model']; return new ExpressionEngineUserProvider($this->app['hash'], $model); }); }
/** * Boot the provider, adding the "gatekeeper" type to the Auth handling * * @param Router $router Laravel router instance */ public function boot(Router $router) { Auth::extend('gatekeeper', function ($app) { return new UserProvider(); }); parent::boot($router); }
/** * Bootstrap the application services. * * @return void */ public function boot() { $this->publishes([__DIR__ . '/config/adauth.php' => config_path('adauth.php')], 'config'); Auth::extend('ads', function () { return new ADAuthUserProvider(); }); }
/** * Register any application authentication / authorization services. * * @param \Illuminate\Contracts\Auth\Access\Gate $gate * @return void */ public function boot(GateContract $gate) { $this->registerPolicies($gate); Auth::extend('api_token', function ($app, $name, array $config) { return new ApiTokenGuard(Auth::createUserProvider($config['provider']), $this->app['request']); }); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { Auth::extend('iget-token', function ($app, $name, array $config) { $guard = new TokenGuard(Auth::createUserProvider($config['provider']), $app['request']); $app->refresh('request', $guard, 'setRequest'); return $guard; }); }
/** * Boot the service provider. */ public function boot() { Auth::extend('jwt', function ($app, $name, array $config) { return new JwtGuard($app['auth']->createUserProvider($config['provider']), $app[JwtService::class], $app['request']); }); $this->publishConfig(); $this->publishMigration(); }
/** * Bootstrap the application events. * * @return void */ public function boot() { $this->package('ckylape/oauth-with-db'); Auth::extend('oauth-with-db', function ($app) { $provider = new OAuthWithDatabaseUserProvider(); return new OAuthWithDatabaseGuard($provider, $app['session.store']); }); }
/** * Bootstrap the application services. * * @param Repository $config */ public function boot(Repository $config) { $this->loadViewsFrom(__DIR__ . '/../views', 'ghi'); $this->publishes([__DIR__ . '/../views' => base_path('resources/views/vendor/ghi')]); $model = $config->get('auth.model'); Auth::extend('ghi-intranet', function ($app) use($model) { return new IntranetUserAuthProvider($model); }); }
/** * Run service provider boot operations. * * @return void */ public function boot() { $auth = __DIR__ . '/Config/auth.php'; $this->mergeConfigFrom($auth, 'adldap_auth'); $this->publishes([$auth => config_path('adldap_auth.php')], 'adldap'); Auth::extend('adldap', function ($app) { return new AdldapAuthUserProvider($app['hash'], $app['config']['auth.model']); }); }
/** * Register any application services. * * @return void */ public function register() { Auth::extend('userEloquent', function ($app) { // you can use Config::get() to retrieve the model class name from config file $myProvider = new EloquentUserProvider($app['hash'], '\\App\\Models\\User'); return new Guard($myProvider, $app['session.store']); }); $this->app->singleton('auth.driver_user', function ($app) { return Auth::driver('userEloquent'); }); }
/** * 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'); // Extend Laravel authentication with Adldap driver. Auth::extend('adldap', function ($app) { return new AdldapAuthUserProvider($app['hash'], $app['config']['auth.model']); }); }
/** * Perform post-registration booting of services. * * @return void */ public function boot(GateContract $gate) { $this->registerPolicies($gate); Auth::extend('auth-token', function ($app, $name, array $config) { return new TokenGuard(Auth::createUserProvider($config['provider']), $app['request']); }); $this->publishes([__DIR__ . '/../config/api.php' => config_path('api.php')], 'config'); $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations'); if (!$this->app->routesAreCached()) { require __DIR__ . '/Http/routes.php'; } }
public function boot() { // loading the routes from the routes file. if (!$this->app->routesAreCached()) { require __DIR__ . '/Http/routes.php'; } Auth::extend('eloquent', function ($app) { return new CustomEloquentUserProvider($app['hash'], $app['config']['auth.model']); }); // define the path to views $this->loadViewsFrom(__DIR__ . '/../views', 'users'); $this->publishes([__DIR__ . '/config/user.php' => config_path('user.php'), __DIR__ . '/../database/migrations/2015_07_16_200000_create_roles_table.php' => base_path('database/migrations/2015_07_16_000000_create_roles_table.php'), __DIR__ . '/../database/migrations/2015_07_16_100000_create_permissions_table.php' => base_path('database/migrations/2015_07_16_000000_create_permissions_table.php'), __DIR__ . '/../database/migrations/2015_07_16_400000_create_user_roles_table.php' => base_path('database/migrations/2015_07_16_000000_create_user_roles_table.php'), __DIR__ . '/../database/migrations/2015_07_16_300000_create_role_permissions_table.php' => base_path('database/migrations/2015_07_16_000000_create_user_permissions_table.php'), __DIR__ . '/../database/seeds/UsersTableSeeder.php' => base_path('database/seeds/UsersTableSeeder.php'), __DIR__ . '/../database/seeds/RolesTableSeeder.php' => base_path('database/seeds/RolesTableSeeder.php'), __DIR__ . '/../database/seeds/PermissionsTableSeeder.php' => base_path('database/seeds/PermissionsTableSeeder.php'), __DIR__ . '/../database/seeds/RolePermissionsTableSeeder.php' => base_path('database/seeds/RolePermissionsTableSeeder.php'), __DIR__ . '/../views/partials/menubar.blade.php' => base_path('resources/views/menubar.blade.php')]); }
public function boot() { if (\Config::get('doctrine')) { $em = $this->app->make('Doctrine\\ORM\\EntityManager'); $driver = \Doctrine\ORM\Mapping\Driver\AnnotationDriver::create(__DIR__); $driverChain = $em->getConfiguration()->getMetadataDriverImpl(); $driverChain->addDriver($driver, 'Barnetik\\DoctrineAuth'); } Auth::extend('doctrine', function ($app) { $provider = new DoctrineUserProvider($app->make('Doctrine\\ORM\\EntityManager'), config('auth.model')); return new \Illuminate\Auth\Guard($provider, $app['session.store']); }); $this->commands(['Barnetik\\DoctrineAuth\\Console\\Commands\\CreateUser', 'Barnetik\\DoctrineAuth\\Console\\Commands\\PublishUserModel']); }
/** * 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.model', \App\User::class)); }); // Add authentication driver Auth::extend('contactable', function ($app) { // Return an instance of Illuminate\Contracts\Auth\UserProvider... return $app->make('ContactableAuthProvider'); }); }
/** * Boot the provider, adding the "gatekeeper" type to the Auth handling * * @param Router $router Laravel router instance */ public function boot(Router $router) { // Add Gatekeeper to the Auth provider list Auth::extend('gatekeeper', function ($app) { return new UserProvider(); }); // Create a new "unique" (gkunique) validator for unique user checking Validator::extend('gk_unique', function ($attribute, $value, $parameters) { $type = isset($parameters[0]) ? $parameters[0] : 'user'; // strip a training "s" if there is one if (substr($type, -1) === 's') { $type = substr($type, 0, strlen($type) - 1); } $method = 'find' . ucwords($type) . 'By' . ucwords($attribute); try { $user = Gatekeeper::$method($value); return $user === false; } catch (\Exception $e) { return false; } }); parent::boot($router); }
/** * Bootstrap JWT auth driver */ public function boot() { Auth::extend('jwt', function ($app) { return new Driver($this->createUserProvider($app)); }); }
/** * Bootstrap any application services. * * @return void */ public function boot() { Auth::extend('roles', function () { return new ExtendedGuard(new EloquentUserProvider(App::make('hash'), Config::get('auth.model')), App::make('session.store')); }); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { Auth::extend('oauth', function ($app, $name, array $config) { return new OAuthGuard(Auth::createUserProvider($config['provider']), $this->app['request']); }); }
/** * Bootstrap the application events. * * @return void */ public function boot() { Auth::extend('cent', function () { return new Cent(); }); }
/** * Bootstrap the application services. * * @return void */ public function boot() { Auth::extend('ldap', function ($app) { return new LdapProvider($app['config']['auth.model']); }); }