Register Bouncer as a singleton.

@return void
187913
protected function registerBouncer()
    {
        $this->app->singleton(Bouncer::class, function () {
            return Bouncer::make()
                ->withClipboard(new CachedClipboard(new ArrayStore))
                ->withGate($this->app->make(Gate::class))
                ->create();
        });
    }
613447
private function registerClassloader()
    {
        // Register core classloader
        require_once ('SplClassLoader.php');

        // Classloader to register
        $register = [
            'Core' => $this->basedir,
            'Apps' => $this->basedir,
            'AppsSec' => $this->basedir,
            'Themes' => $this->basedir
        ];

        // Register classloader
        foreach ($register as $key => $path) {
            $loader = new \SplClassLoader($key, $path);
            $loader->register();
        }
    }
276269
public function register()
    {
        foreach ($this->singletonClassMap as $abstract => $concrete)
        {
            $this->app->singleton($abstract, function() use ($concrete)
            {
                return $this->app->make($concrete);
            });
        }
    }
511233
protected function registerWorker()
    {
        $this->app->singleton('queue.worker', function () {
            return new Worker(
                $this->app['queue'], $this->app['events'], $this->app[ExceptionHandler::class]
            );
        });
    }
1330130
protected function registerThrottleProvider()
	{
		$this->app->singleton('sentry.throttle', function($app)
		{
			$config = $app['config']->get('cartalyst.sentry');

			$model = array_get($config, 'throttling.model');

			$throttleProvider = new ThrottleProvider($app['sentry.user'], $model);

			if (array_get($config, 'throttling.enabled') === false)
			{
				$throttleProvider->disable();
			}

			if (method_exists($model, 'setAttemptLimit'))
			{
				$attemptLimit = array_get($config, 'throttling.attempt_limit');

				forward_static_call_array(
					array($model, 'setAttemptLimit'),
					array($attemptLimit)
				);
			}
			if (method_exists($model, 'setSuspensionTime'))
			{
				$suspensionTime = array_get($config, 'throttling.suspension_time');

				forward_static_call_array(
					array($model, 'setSuspensionTime'),
					array($suspensionTime)
				);
			}

			// Define the User model to use for relationships.
			if (method_exists($model, 'setUserModel'))
			{
				$userModel = array_get($config, 'users.model');

				forward_static_call_array(
					array($model, 'setUserModel'),
					array($userModel)
				);
			}

			return $throttleProvider;
		});
	}
576583
public function register()
    {
        $this->app->singleton('Illuminate\Contracts\Auth\Guard', function () {
            $hasher = $this->app->make('Illuminate\Contracts\Hashing\Hasher');
            $session = $this->app->make('Symfony\Component\HttpFoundation\Session\SessionInterface');

            $provider = new EloquentUserProvider($hasher, 'FluxBB\Models\User');
            $guard = new Guard($provider, $session);

            $guard->setCookieJar($this->app->make('Illuminate\Contracts\Cookie\QueueingFactory'));
            $guard->setDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
            $guard->setRequest($this->app->make('Symfony\Component\HttpFoundation\Request'));

            return $guard;
        });

        if (Core::isInstalled()) {
            $this->app->extend('view', function ($view) {
                $view->share('user', $this->app->make('Illuminate\Contracts\Auth\Guard')->user());

                return $view;
            });
        }
    }
98776
public function register()
	{
		if ($this->app->has('component'))
		{
			$this->app->forget('component');
		}

		$this->app['component'] = function($app)
		{
			return new Loader($app);
		};
	}
611632
public function run()
    {
        Bouncer::allow('superadmin')->everything();

        $abilities = [
            ['name' => 'list', 'title' => 'List abilities', 'entity_type' => 'ability'],
            ['name' => 'import', 'title' => 'Import abilities', 'entity_type' => 'ability'],
            ['name' => 'create', 'title' => 'Create abilities', 'entity_type' => 'ability'],
            ['name' => 'update', 'title' => 'Update abilities', 'entity_type' => 'ability'],
            ['name' => 'delete', 'title' => 'Delete abilities', 'entity_type' => 'ability'],
            ['name' => 'audit', 'title' => 'Audit abilities', 'entity_type' => 'ability'],
            ['name' => 'grant', 'title' => 'Grant abilities', 'entity_type' => 'ability'],

            ['name' => 'list', 'title' => 'List roles', 'entity_type' => 'role'],
            ['name' => 'import', 'title' => 'Import roles', 'entity_type' => 'role'],
            ['name' => 'create', 'title' => 'Create roles', 'entity_type' => 'role'],
            ['name' => 'update', 'title' => 'Update roles', 'entity_type' => 'role'],
            ['name' => 'delete', 'title' => 'Delete roles', 'entity_type' => 'role'],
            ['name' => 'audit', 'title' => 'Audit roles', 'entity_type' => 'role'],
            ['name' => 'assign', 'title' => 'Assign roles', 'entity_type' => 'role'],

            ['name' => 'list', 'title' => 'List admins', 'entity_type' => 'admin'],
            ['name' => 'import', 'title' => 'Import admins', 'entity_type' => 'admin'],
            ['name' => 'create', 'title' => 'Create admins', 'entity_type' => 'admin'],
            ['name' => 'update', 'title' => 'Update admins', 'entity_type' => 'admin'],
            ['name' => 'delete', 'title' => 'Delete admins', 'entity_type' => 'admin'],
            ['name' => 'audit', 'title' => 'Audit admins', 'entity_type' => 'admin'],

            ['name' => 'list', 'title' => 'List members', 'entity_type' => 'member'],
            ['name' => 'import', 'title' => 'Import members', 'entity_type' => 'member'],
            ['name' => 'create', 'title' => 'Create members', 'entity_type' => 'member'],
            ['name' => 'update', 'title' => 'Update members', 'entity_type' => 'member'],
            ['name' => 'delete', 'title' => 'Delete members', 'entity_type' => 'member'],
            ['name' => 'audit', 'title' => 'Audit members', 'entity_type' => 'member'],

            ['name' => 'list', 'title' => 'List managers', 'entity_type' => 'manager'],
            ['name' => 'import', 'title' => 'Import managers', 'entity_type' => 'manager'],
            ['name' => 'create', 'title' => 'Create managers', 'entity_type' => 'manager'],
            ['name' => 'update', 'title' => 'Update managers', 'entity_type' => 'manager'],
            ['name' => 'delete', 'title' => 'Delete managers', 'entity_type' => 'manager'],
            ['name' => 'audit', 'title' => 'Audit managers', 'entity_type' => 'manager'],

            ['name' => 'list', 'title' => 'List guardians', 'entity_type' => 'guardian'],
            ['name' => 'import', 'title' => 'Import guardians', 'entity_type' => 'guardian'],
            ['name' => 'create', 'title' => 'Create guardians', 'entity_type' => 'guardian'],
            ['name' => 'update', 'title' => 'Update guardians', 'entity_type' => 'guardian'],
            ['name' => 'delete', 'title' => 'Delete guardians', 'entity_type' => 'guardian'],
            ['name' => 'audit', 'title' => 'Audit guardians', 'entity_type' => 'guardian'],
        ];

        collect($abilities)->each(function (array $ability) {
            app('cortex.auth.ability')->create($ability);
        });
    }
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);
            });
        }
    }
44357
protected function registerBeacon()
    {
        $this->app->singleton(BeaconContract::class, function ($app) {
            $config = $app['config'];

            return new Beacon($config);
        });
    }
632184
public function register() {
		if ($this->app->runningInConsole()) {
			$this->registerConsoleCommands();
			$this->app->singleton(DatabaseMigrationCommand::class, function ($app) {
				return new DatabaseMigrationCommand($app->make('migrator'), $app->make(DatabaseManager::class));
			});
			$this->app->singleton(DatabaseRollbackCommand::class, function ($app) {
				return new DatabaseRollbackCommand($app->make('migrator'), $app->make(DatabaseManager::class));
			});
			$this->app->singleton(DatabaseResetCommand::class, function ($app) {
				return new DatabaseResetCommand($app->make('migrator'), $app->make(DatabaseManager::class));
			});
			$this->app->singleton(DatabaseRefreshCommand::class, function ($app) {
				return new DatabaseRefreshCommand($app->make('migrator'), $app->make(DatabaseManager::class));
			});
			$this->app->singleton(DatabaseFreshCommand::class, function ($app) {
				return new DatabaseFreshCommand($app->make(DatabaseManager::class));
			});
			$this->app->singleton(DatabaseSeedCommand::class, function ($app) {
				return new DatabaseSeedCommand($app->make('db'), $app->make(DatabaseManager::class));
			});

		}
		$this->registerPublishables();
		$this->registerHelpers();
	}
1032755
public function register()
    {
        $this->registerLoader();

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

        $this->app->singleton( Registrar::class, function( $app ){
            return new Registrar;
        });

        $this->app->singleton( HelpersBlueprint::class, Helpers::class );

        $this->app->singleton( 'ensphere.exception.handler', function( $app ) {
            return new Bucket();
        });

        $this->app->singleton( ProcessorRegistrar::class, function( $app ) {
            return new ProcessorRegistrar;
        });

        $this->commands([
            RenameCommand::class,
            ExportCommand::class,
            ImportCommand::class,
            BowerCommand::class,
            MigrateCommand::class,
            RegistrationCommand::class,
            InstallCommand::class,
            UpdateCommand::class,
            MakeCommand::class,
            DatabaseCommand::class,
            ModulesCommand::class,
            ExternalAssetsCommand::class,
            DotEnv::class,
            ExtendCommand::class,
            InformCentralHub::class,
            PostProcessCommand::class,
            PreProcessCommand::class,
            BackResourceCommand::class,
            MigrationSeedCommand::class,
            SearchAndReplaceCommand::class,
            MediaCleanseCommand::class,
            JsRoutesCommand::class,
        ]);
    }
216611
public function register()
    {
        // Register Menu Singleton
        $this->app->singleton('menu', function (Application $app) {
            return $app->make(Menu::class);
        });

        // Facade Alias
        $this->app->booting(function () {
            $loader = AliasLoader::getInstance();
            $loader->alias('Menu', MenuFacade::class);
        });
    }
1239866
public function register()
    {
        $this->app->bind(SessionStoreInterface::class, LaravelSessionStore::class);

        $this->app->singleton('alert', function () {
            return $this->app->make(Alert::class);
        });
    }
168707
protected function registerSentry()
	{
		$this->app->singleton('sentry', function($app)
		{
			return new Sentry(
				$app['sentry.user'],
				$app['sentry.group'],
				$app['sentry.throttle'],
				$app['sentry.session'],
				$app['sentry.cookie'],
				$app['request']->getClientIp()
			);
		});

		$this->app->alias('sentry', 'Cartalyst\Sentry\Sentry');
	}
703875
protected function registerManager()
    {
        $this->container->singleton('queue', function ($container) {
            // Once we have an instance of the queue manager, we will register the various
            // resolvers for the queue connectors. These connectors are responsible for
            // creating the classes that accept queue configs and instantiate queues.
            return tap(new QueueManager($container), function ($manager) {
                $this->registerConnectors($manager);
            });
        });
    }