Register the bindings for the JSON Web Token provider.

@return void
163148
protected function registerJWTProvider()
    {
        $this->registerNamshiProvider();
        $this->registerLcobucciProvider();

        $this->app->singleton('tymon.jwt.provider.jwt', function ($app) {
            return $this->getConfigInstance('providers.jwt');
        });
    }
1098800
public function registerAssets()
    {
        $this->clientOptions = array_merge([
            'id' => $this->options['id'],
            'url' => Url::to(['/notifications/default/list']),
            'countUrl' => Url::to(['/notifications/default/count']),
            'readUrl' => Url::to(['/notifications/default/read']),
            'readAllUrl' => Url::to(['/notifications/default/read-all']),
            'xhrTimeout' => Html::encode($this->xhrTimeout),
            'pollInterval' => Html::encode($this->pollInterval),
        ], $this->clientOptions);

        $js = 'Notifications(' . Json::encode($this->clientOptions) . ');';
        $view = $this->getView();

        NotificationsAsset::register($view);

        $view->registerJs($js);
    }
1061068
public function registerJs()
    {
        if (!isset($this->clientOptions['create']) && empty($this->items)) {
            $this->clientOptions['create'] = "function(input) { return { value: input, text: input };}";
        }
        $clientOptions = (count($this->clientOptions)) ? Json::encode($this->clientOptions) : '';
        $this->getView()->registerJs("jQuery('#{$this->options['id']}').selectize({$clientOptions});");
    }
219632
public function register()
    {
        $this->di->setShared(
            'authServer',

            function () {
                /* @var \Pails\Container $this */

                // Init repositories
                $clientRepository = new ClientRepository();
                $scopeRepository = new ScopeRepository();
                $accessTokenRepository = new AccessTokenRepository();
                $authCodeRepository = new AuthCodeRepository();
                $userRepository = new UserRepository();
                $refreshTokenRepository = new RefreshTokenRepository();

                // Keys
                $privateKey = $this['config']->get('oauth2.private_key');
                $publicKey = $this['config']->get('oauth2.public_key');

                // Setup authorization server
                $server = new AuthorizationServer(
                    $clientRepository,
                    $accessTokenRepository,
                    $scopeRepository,
                    $privateKey,
                    $publicKey);

                if ($this['config']->get('oauth2.client_credential.enabled')) {
                    // clientGrant
                    $server->enableGrantType(
                        new ClientCredentialsGrant(),
                        seconds2interval($this['config']->get('oauth2.client_credential.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.password.enabled')) {
                    // passwordGrant
                    $passwordGrant = new PasswordGrant(
                        $userRepository,
                        $refreshTokenRepository
                    );
                    $passwordGrant->setRefreshTokenTTL(seconds2interval($this['config']->get('oauth2.password.refresh_token_ttl', 2592000)));
                    $server->enableGrantType(
                        $passwordGrant,
                        seconds2interval($this['config']->get('oauth2.password.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.auth_code.enabled')) {
                    // authCodeGrant
                    $authCodeGrant = new AuthCodeGrant(
                        $authCodeRepository,
                        $refreshTokenRepository,
                        seconds2interval($this['config']->get('oauth2.auth_code.code_ttl', 3600))
                    );
                    $authCodeGrant->setRefreshTokenTTL(seconds2interval($this['config']->get('oauth2.auth_code.refresh_token_ttl', 2592000)));
                    $server->enableGrantType(
                        $authCodeGrant,
                        seconds2interval($this['config']->get('oauth2.auth_code.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.refresh_token.enabled')) {
                    // refreshTokenGrant
                    $refreshTokenGrant = new RefreshTokenGrant(
                        $refreshTokenRepository
                    );
                    $server->enableGrantType(
                        $refreshTokenGrant,
                        seconds2interval($this['config']->get('oauth2.refresh_token.token_ttl', 3600))
                    );
                }

                if ($this['config']->get('oauth2.implicit.enabled')) {
                    // implicit grant
                    $server->enableGrantType(
                        new ImplicitGrant(seconds2interval($this['config']->get('oauth2.implicit.token_ttl', 3600))),
                        seconds2interval($this['config']->get('oauth2.implicit.token_ttl', 3600))
                    );
                }

                return $server;
            }
        );

        $this->di->setShared(
            'resourceServer',

            function () {
                /* @var \Pails\Container $this */
                $accessTokenRepository = new AccessTokenRepository();
                $publicKey = $this['config']->get('oauth2.public_key');

                $resourceServer = new ResourceServer($accessTokenRepository, $publicKey);

                return $resourceServer;
            }
        );

        $this->di->setShared(
            'authClient',

            function () {
                /* @var \Pails\Container $this */
                $provider = new GenericProvider([
                    'clientId'                => $this['config']->get('oauth2.client.client_id'),
                    'clientSecret'            => $this['config']->get('oauth2.client.client_secret'),
                    'redirectUri'             => $this['config']->get('oauth2.client.redirect_url'),
                    'urlAuthorize'            => $this['config']->get('oauth2.client.authorize_url'),
                    'urlAccessToken'          => $this['config']->get('oauth2.client.access_token_url'),
                    'urlResourceOwnerDetails' => $this['config']->get('oauth2.client.resource_owner_url'),
                ]);

                return $provider;
            }
        );
    }
489078
public static function register()
    {
        $namespace = "Vinala\App\Events";

        foreach (get_declared_classes() as $value) {
            if (Strings::contains($value, $namespace)) {
                $name = self::getName($value);

                $events = $value::getEvents();

                if (!is_null($events)) {
                    foreach ($events as $key => $value) {
                        $data[$name.'.'.$key] = $value;
                    }
                }

                self::$listners = array_collapse([$data, self::$listners]);
            }
        }
    }
925106
public function registerDefaults()
    {
        if (!array_key_exists('token', $this->options)) {
            throw new ApiTokenMissingException('An API token was not configured, please configure the `token` option with an correct ApiToken() object.');
        }

        $requestSubscriber = new RequestSubscriber();
        $this->addSubscriber($requestSubscriber);

        $hydrationSubscriber = new HydrationSubscriber();
        $this->addSubscriber($hydrationSubscriber);

        $apiTokenPlugin = new ApiTokenPlugin(
            is_string($this->options['token']) ?
                new ApiToken($this->options['token']):
                $this->options['token']
        );

        $this->addSubscriber($apiTokenPlugin);

        $acceptJsonHeaderPlugin = new AcceptJsonHeaderPlugin();
        $this->addSubscriber($acceptJsonHeaderPlugin);

        $contentTypeHeaderPlugin = new ContentTypeJsonHeaderPlugin();
        $this->addSubscriber($contentTypeHeaderPlugin);

        $userAgentHeaderPlugin = new UserAgentHeaderPlugin();
        $this->addSubscriber($userAgentHeaderPlugin);

        return $this;
    }
1323112
public function register()
    {
        parent::register();

        $this->registerConfig();

        $this->singleton(Contracts\Http\JsonResponse::class, Http\JsonResponder::class);
    }
1177098
public function register()
    {
        $this->app->singleton('localization.js', function ($app) {

            $files = $app['files'];
            $langs = $app['path.base'].'/resources/lang';
            $messages = $app['config']->get('localization-js.messages');
            $generator = new Generators\LangJsGenerator($files, $langs, $messages);

            return new Commands\LangJsCommand($generator);
        });

        // Bind the Laravel JS Localization command into Laravel Artisan.
        $this->commands('localization.js');
    }
233583
protected function registerTokenRepository()
    {
        $this->app->singleton('auth.password.tokens', function($app)
        {
            $connection = $app['db']->connection();

            // The database token repository is an implementation of the token repository
            // interface, and is responsible for the actual storing of auth tokens and
            // their e-mail addresses. We will inject this table and hash key to it.
            $table = $app['config']['auth.password.table'];

            $key = $app['config']['app.key'];

            $expire = $app['config']->get('auth.password.expire', 60);

            return new DbRepository($connection, $table, $key, $expire);
        });
    }
324483
protected function registerAssets()
    {
        $view = $this->getView();
        $clientOptions = Json::encode($this->clientOptions);
        $js = 'jQuery("div#' . $this->options['id'] . '").raty(' . $clientOptions . ');';
        $view->registerJs($js);
    }
914909
private function registerBindings()
    {
        $this->app->bind('society.isInstalled', function ($app) {
            return
                file_exists(base_path('.env')) &&
                file_exists(storage_path('app/installed')) &&
                Schema::hasTable('migrations');
        });
    }
1042719
public function register()
    {

        // implementation bindings:
        //-------------------------
        $this->app->bind(
            'Vinelab\Cdn\Contracts\CdnInterface',
            'Vinelab\Cdn\Cdn'
        );

        $this->app->bind(
            'Vinelab\Cdn\Providers\Contracts\ProviderInterface',
            'Vinelab\Cdn\Providers\AwsS3Provider'
        );

        $this->app->bind(
            'Vinelab\Cdn\Contracts\AssetInterface',
            'Vinelab\Cdn\Asset'
        );

        $this->app->bind(
            'Vinelab\Cdn\Contracts\FinderInterface',
            'Vinelab\Cdn\Finder'
        );

        $this->app->bind(
            'Vinelab\Cdn\Contracts\ProviderFactoryInterface',
            'Vinelab\Cdn\ProviderFactory'
        );

        $this->app->bind(
            'Vinelab\Cdn\Contracts\CdnFacadeInterface',
            'Vinelab\Cdn\CdnFacade'
        );

        $this->app->bind(
            'Vinelab\Cdn\Contracts\CdnHelperInterface',
            'Vinelab\Cdn\CdnHelper'
        );

        $this->app->bind(
            'Vinelab\Cdn\Validators\Contracts\ProviderValidatorInterface',
            'Vinelab\Cdn\Validators\ProviderValidator'
        );

        $this->app->bind(
            'Vinelab\Cdn\Validators\Contracts\CdnFacadeValidatorInterface',
            'Vinelab\Cdn\Validators\CdnFacadeValidator'
        );

        $this->app->bind(
            'Vinelab\Cdn\Validators\Contracts\ValidatorInterface',
            'Vinelab\Cdn\Validators\Validator'
        );

        // register the commands:
        //-----------------------
        $this->app->singleton('cdn.push', function ($app) {
            return $app->make('Vinelab\Cdn\Commands\PushCommand');
        });
        $this->commands('cdn.push');

        $this->app->singleton('cdn.empty', function ($app) {
            return $app->make('Vinelab\Cdn\Commands\EmptyCommand');
        });
        $this->commands('cdn.empty');

        // facade bindings:
        //-----------------

        // Register 'CdnFacade' instance container to our CdnFacade object
        $this->app->singleton('cdn', function ($app) {
            return $app->make('Vinelab\Cdn\CdnFacade');
        });

        // Shortcut so developers don't need to add an Alias in app/config/app.php
        $this->app->booting(function () {
            $loader = \Illuminate\Foundation\AliasLoader::getInstance();
            $loader->alias('Cdn', 'Vinelab\Cdn\Facades\CdnFacadeAccessor');
        });
    }
193532
protected function registerJWTProvider()
    {
        $this->app->singleton('tymon.jwt.provider.jwt', function ($app) {
            $provider = $this->config('providers.jwt');

            return new $provider(
                $this->config('secret'),
                $this->config('algo'),
                $this->config('keys')
            );
        });
    }
188097
public function register()
    {
        $this->setConfigPath();
        $this->assertConfigDir();

        $mikado = new Mikado();

        foreach (new DirectoryIterator($this->configPath) as $fileInfo) {
            if ($fileInfo->isDot()) {
                continue;
            }
            $this->addManager($fileInfo, $mikado);
        }

        $this->app->singleton('kriskbx\mikado\Mikado', function ($app) use ($mikado) {
            return $mikado;
        });
    }
856
protected function registerJWTAuth()
    {
        $this->app->singleton('tymon.jwt.auth', function ($app) {
            return (new JWTAuth(
                $app['tymon.jwt.manager'],
                $app['tymon.jwt.provider.auth'],
                $app['tymon.jwt.parser']
            ))->lockSubject($this->config('lock_subject'));
        });
    }
416622
public function register()
    {
        // Load package config to allow use of values
        Config::package('antarctica/laravel-token-blacklist', __DIR__.'/../../config');

        // Register package dependencies' service providers and aliases (so the user doesn't have to in app/config/app.php)
        $this->app->register('Indatus\Dispatcher\ServiceProvider');

        // Register package interfaces with their corresponding implementations
        $this->app->bind(
            'Antarctica\LaravelTokenBlacklist\Repository\TokenBlacklistRepositoryInterface',
            Config::get('laravel-token-blacklist::repository')
        );
    }
715600
protected function registerClient()
    {
        $view = $this->getView();
        TreeViewAsset::register($view);

        $selector = ArrayHelper::remove($this->clientOptions, 'selector', 'ol.sortable');
        $view->registerJs("ns = $('{$selector}').nestedSortable(" . Json::htmlEncode($this->clientOptions) . ");");

        $treeView = $this->options['id'];
        $loading = $this->loadingOptions['id'];
        $view->registerJs(<<<JS
treeView = $('#{$treeView}');
loading = $('#{$loading}');
JS
        );
    }