Register the scanner.

@return void
481275
protected function registerRouteScanner()
    {
        $this->app->singleton('annotations.route.scanner', function ($app) {
            $scanner = new RouteScanner([]);

            $scanner->addAnnotationNamespace(
              'Collective\Annotations\Routing\Annotations\Annotations',
              __DIR__.'/Routing/Annotations/Annotations'
            );

            return $scanner;
        });
    }
822067
public function register()
    {
        $this->app->singleton('command.debug', function () {
            $loop = LoopFactory::create();

            return new DebugCommand($loop);
        });

        $this->commands('command.debug');
    }
617288
public function register(): void
    {
        $this->app->singleton('alert', function (Container $app) {
            $session = $app['session.store'];

            return new Alert($session);
        });

        $this->app->alias('alert', Alert::class);
    }
1093656
public function register()
    {
        ini_set('display_errors', false);
        set_exception_handler([$this, 'handleException']);
        set_error_handler([$this, 'handleError']);

        if ($this->memoryReserveSize > 0) {
            $this->_memoryReserve = str_repeat('x', $this->memoryReserveSize);
        }
        register_shutdown_function([$this, 'handleFatalError']);
    }
115742
public function register()
    {
        $this->app->bindIf(IndexManagerInterface::class, DefaultManager::class);
        $this->app->resolving(DefaultManager::class, function(DefaultManager $manager) {
            $manager->addIndex(Page::class, PageIndex::class);
        });
    }
50812
public function register() {
        $this->app->singleton(PackageMigrateCommand::class, function () {
            return new PackageMigrateCommand($this->app['migrator'], $this->app[AutomaticMigrator::class]);
        });
    }
18025
protected function registerEntityScanner()
    {
        $app = $this->app;

        $app->singleton('datamapper.entity.scanner', function ($app) {
            $reader = $app['datamapper.annotationreader'];

            $validator = new EntityValidator;

            return new EntityScanner($reader, $validator);
        });
    }
1268927
public function register()
    {
        $this->registerLangFileManager();
        $this->setupRoutes($this->app->router);

        $this->app->singleton('langfile', function ($app) {
            return new LangFiles($app['config']['app']['locale']);
        });

        // use this if your package has a config file
        // config([
        //         'config/langfilemanager.php',
        // ]);
    }
628591
public function register() {
		$this->files = new Filesystem;
		$this->registerScanCommand();

		$method = "singleton";
		// Bind the manager as a singleton on the container.
		$this->app->$method('permacon', function($app) {
			
			/**
			 * Construct the actual manager.
			 */
			return new Permacon($app);
		});
	}
448423
public function register()
    {

        // include the package config
        $this->mergeConfigFrom(
            __DIR__.'/../config/blade.php', 'blade'
        );

        // load the alias (handled by the Laravel autoloader)
        //$this->app->alias('StringBlade', 'Wpb\String_Blade_Compiler\Facades\StringBlade');

        $this->registerEngineResolver();

        $this->registerViewFinder();

        $this->registerFactory();
    }
464253
public function register()
    {
        $this->registerRepository();
        $this->registerMigrator();
        $this->registerTranslation();
        // for create migration
        $this->registerCreator();
        // for create migration

        // add commands
        $this->registerCommands();


    }
1126231
public function register()
    {
        $this->app->singleton('larinfo', function ($app) {
            $larinfo = new Larinfo(new Ipinfo(), new Request(), new Linfo(), new Manager());

            $token = config('services.ipinfo.token');

            if (! empty($token)) {
                return $larinfo->setIpinfoConfig($token);
            }

            $larinfo->setDatabaseConfig(config('database.connections.'.config('database.default')));

            return $larinfo;
        });
    }
575741
public function register()
    {
        /*
         * Register the e-mail checker
         */
        $this->app->singleton(EmailChecker::class, function ($app) {
            return new EmailChecker();
        });

        /*
         * Alias the dependency for ease.
         */
        $this->app->alias(EmailChecker::class, 'email.checker');
    }
23192
public function register()
    {
        $this->app->singleton('searchIndex', function ($app) {
            switch ($app['config']->get('searchindex.engine')) {
                case 'elasticsearch':

                    $config = $app['config']->get('searchindex.elasticsearch');

                    $elasticSearchClient = new ElasticsearchClient(
                        [
                            'hosts'    => $config['hosts'],
                            'logPath'  => $config['logPath'],
                            'logLevel' => $config['logLevel'],
                        ]
                    );

                    $searchHandler = new ElasticSearchHandler($elasticSearchClient);

                    $searchHandler->setIndexName($config['defaultIndexName']);

                    return $searchHandler;

                    break;

                case 'algolia':

                    $config = $app['config']->get('searchindex.algolia');

                    $algoliaClient = new \AlgoliaSearch\Client(
                        $config['application-id'],
                        $config['api-key']
                    );

                    $searchHandler = new Algolia($algoliaClient);

                    $searchHandler->setIndexName($config['defaultIndexName']);

                    return $searchHandler;

                    break;
            }

            throw new Exception($app['config']->get('searchindex.engine').' is not a valid search engine');
        });
    }
693325
public function register()
    {

        $app = $this->app;

        $this->singleton(Crypter::class, function() use($app){

            $cipher = $app['config']->get('crypt.cipher');
            $appKey = $app['config']->get('general.app_key');

            $cipher = $app->make($cipher, [$appKey]);

            return new Crypter($cipher);
        });

    }
1211750
public function register()
    {
        $this->mergeConfigFrom(
            __DIR__.'/../config/eloquent-viewable.php',
            'eloquent-viewable'
        );

        $this->app->when(Views::class)
            ->needs(CacheRepository::class)
            ->give(function () : CacheRepository {
                return $this->app['cache']->store(config('eloquent-viewable.cache.store'));
            });

        $this->app->bind(ViewContract::class, View::class);

        $this->app->bind(CrawlerDetectAdapter::class, function ($app) {
            $detector = new CrawlerDetect(
                $app['request']->headers->all(),
                $app['request']->server('HTTP_USER_AGENT')
            );

            return new CrawlerDetectAdapter($detector);
        });

        $this->app->singleton(CrawlerDetectorContract::class, CrawlerDetectAdapter::class);
        $this->app->singleton(IpAddressResolverContract::class, IpAddressResolver::class);
        $this->app->singleton(HeaderResolverContract::class, HeaderResolver::class);
    }
1032755
public function register()
    {
        $this->registerLoader();

        $this->app->singleton('webklex.translator', function ($app) {
            return new Translator($app['webklex.translator.loader'], $app->getLocale());
        });
    }