Register the factory class.

@return void
763321
protected function registerFactory(): void
    {
        $this->app->singleton('facebook.factory', function () {
            return new FacebookFactory();
        });

        $this->app->alias('facebook.factory', FacebookFactory::class);
    }
512781
public function register()
    {
        $this->mergeConfigFrom(__DIR__ . '/config/laravel-random.php', 'laravel-random');
        
        $this->app->singleton('random', function ($app) {
            $factory = new \RandomLib\Factory;
            
            $strength = $app['config']->get('laravel-random.strength');
            
            if ($strength === 'high') {
                return $factory->getHighStrengthGenerator();
            }
            
            if ($strength === 'medium') {
                return $factory->getMediumStrengthGenerator();
            }
            
            return $factory->getLowStrengthGenerator();
        });
    }
333046
public function register()
    {
        set_exception_handler(new ExceptionHandler($this->request, $this->factory));
        register_shutdown_function(new ShutdownHandler($this->request, $this->factory));
    }
469800
public function register()
    {
        $this->bindContracts();
        $this->bindConfig();
        $this->bindSender();
        $this->bindResolver();
        $this->bindNotifynder();

        $this->registerSenders();
    }
884195
public function register()
    {
        $this->app->singleton('Illuminate\Database\ConnectionInterface', function () {
            $factory = new ConnectionFactory($this->app);

            $connection = $factory->make($this->app['config']->get('fluxbb.database'));
            $connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
            $connection->setFetchMode(PDO::FETCH_CLASS);

            return $connection;
        });

        $this->app->singleton('Illuminate\Database\ConnectionResolverInterface', function () {
            $resolver = new ConnectionResolver([
                'fluxbb' => $this->app->make('Illuminate\Database\ConnectionInterface'),
            ]);
            $resolver->setDefaultConnection('fluxbb');

            return $resolver;
        });

        if (Core::isInstalled()) {
            $this->app->booting(function () {
                $resolver = $this->app->make('Illuminate\Database\ConnectionResolverInterface');
                Model::setConnectionResolver($resolver);
            });
        }
    }
288731
public function run()
    {
        foreach ($this->factoryClasses as $modelClass => $factoryClass) {
            /** @var ModelFactory $instance */
            $instance = new $factoryClass;
            $this->registry->define($modelClass, $instance->getDefinition());
        }
    }
415377
def register_factory(self, specification, factory, scope=None):
        
        self.register_provider(
            specification,
            FactoryProvider(factory, scope=scope)
        )
50535
public function boot()
    {
        $this->registerMiddleware();
        $this->registerViewPath();
        $dbFactory = $this->app[EloquentFactory::class];
        $path = __DIR__ . "/../database/factories";
        $dbFactory->load($path);

    }
297351
public function register()
    {
        $this->registerFileConfig();
        $this->registerDatabaseConfig();

        // Bind the concrete types
        $this->app->bind('Concrete\Core\Config\Repository\Repository', 'config');
        $this->app->bind('Illuminate\Config\Repository', 'Concrete\Core\Config\Repository\Repository');
    }
544446
public function registerFactory()
    {
        $this->app->singleton('view', function ($app) {
            // Next we need to grab the engine resolver instance that will be used by the
            // environment. The resolver will be used by an environment to get each of
            // the various engine implementations such as plain PHP or Blade engine.
            $resolver = $app['view.engine.resolver'];

            $finder = $app['view.finder'];

            $factory = $this->createFactory($resolver, $finder, $app['events']);

            // We will also set the container instance on this view environment since the
            // view composers may be classes registered in the container, which allows
            // for great testable, flexible composers for the application developer.
            $factory->setContainer($app);

            $factory->share('app', $app);

            return $factory;
        });
    }
679500
public function register()
    {
        $this->app->singleton(SecurityContext::class);
        $this->app->bind(RepositoryFactory::class, function(Container $container){
            return
                new ContainerBindingRepositoryFactory($container,
                    new ConfigurationRepositoryFactory($container,
                        new DefaultRepositoryFactory($container)
                    )
                );
        });
    }
662042
public function register()
    {
        $this->app->singleton('urlshortener.factory', Drivers\Factory::class);
        $this->app->singleton('urlshortener', function ($app) {
            $shortener = new UrlShortener($app['urlshortener.factory']);
            $shortener->setDriver($app['config']->get('urlshortener.driver'));
            return $shortener;
        });
    }
652615
public function register()
    {
        $container = $this->getContainer();

        /** @var Tapestry $tapestry */
        $tapestry = $container->get(Tapestry::class);
        $configuration = new Configuration(include(__DIR__.'/../../src/Modules/Config/DefaultConfig.php'));

        if ($baseConfigPathName = $this->identifyConfigurationPath($tapestry['currentWorkingDirectory'])) {
            $configuration->merge($this->getConfigurationFromPath($baseConfigPathName));
        }

        if ($envConfigPathName = $this->identifyConfigurationPath($tapestry['currentWorkingDirectory'], $tapestry['environment'])) {
            $configuration->merge($this->getConfigurationFromPath($envConfigPathName));
        }

        $container->share(Configuration::class, $configuration);
    }
1350547
public function register()
    {
        $this->app->singleton('taxonomy.factory', function ($app) {
            return new TaxonomyFactory($app);
        });

        $this->app->alias('taxonomy.factory', TaxonomyFactory::class);
    }
886362
public function register()
    {
        $this->registerConnectionServices();
        $this->registerEloquentFactory();
        $this->registerQueueableEntityResolver();

        Model::setConnectionResolver($this->container['db']);
        Model::setEventDispatcher($this->container['events']);
        Model::clearBootedModels();
        Model::observe(InternalObserve::class);
    }
1152761
public function register()
    {
        parent::register();

        $this->registerLogLevels();
        $this->registerStyler();
        $this->registerLogMenu();
        $this->registerFilesystem();
        $this->registerFactory();
        $this->registerChecker();
    }
274736
public function registerFactory()
    {
        $this->app->singleton('view', function ($app) {
            // Next we need to grab the engine resolver instance that will be used by the
            // factory. The resolver will be used by a factory to get each of
            // the various engine implementations such as plain PHP or Blade engine.
            $resolver = $app['view.engine.resolver'];

            $finder = $app['view.finder'];

            $factory = new View\Factory($resolver, $finder, $app['events'], $app['presenter.decorator']);

            // We will also set the container instance on this view factory since the
            // view composers may be classes registered in the container, which allows
            // for great testable, flexible composers for the application developer.
            $factory->setContainer($app);

            $factory->share('app', $app);

            return $factory;
        });
    }