Register the ServiceProvider according to Laravel version

@return \Redeman\Imgur\Provider\ProviderInterface
498997
private function registerProvider()
    {
        $app = $this->app;

        // Pick the correct service provider for the current verison of Laravel
        $this->provider = (version_compare($app::VERSION, '5.0', '<'))
            ? new ImgurServiceProviderLaravel4($app)
            : new ImgurServiceProviderLaravel5($app);
    }
1094246
protected function registerHttplug()
    {
        $this->app->singleton('httplug', function ($app) {
            return new HttplugManager($app);
        });
        $this->app->alias('httplug', HttplugManager::class);

        $this->app->singleton('httplug.default', function ($app) {
            return $app['httplug']->driver();
        });
    }
1337963
public function register()
    {
        $configPath = __DIR__.'/../config/imageoptimizer.php';
        $this->mergeConfigFrom($configPath, 'imageoptimizer');

        $this->app->singleton('Approached\LaravelImageOptimizer\ImageOptimizer', function ($app) {
            $options = config('imageoptimizer.options');

            // $logger = $this->app->make('log')->getMonolog();
            $logger = new Logger('image_optimizer_log');
            $handler = new StreamHandler(config('imageoptimizer.log_file'), Logger::INFO);
            $logger->pushHandler($handler);

            return new ImageOptimizer($options, $logger);
        });

        $this->app['router']->aliasMiddleware('AutoImageOptimizer', AutoImageOptimizer::class);
    }
268333
protected function registerProvides(ServiceProvider $provider)
    {
        foreach ($provider->provides() as $binding) {
            $this->provides[$binding][] = $provider;
        }
    }
701250
public function register() {
		// if the provider method exists then we are at least in Laravel 5.1
		if(method_exists('Illuminate\Auth\AuthManager', 'provider')) {
			// LDAP auth extension
			Auth::provider('ldap', function($app, array $config) {
				return new \CSUNMetaLab\Authentication\Providers\UserProviderLDAP();
			});

			// database auth extension
			Auth::provider('dbauth', function($app, array $config) {
				return new \CSUNMetaLab\Authentication\Providers\UserProviderDB();
			});
		}
		else
		{
			// Laravel 5.0
			Auth::extend('ldap', function() {
				return new Guard(new \CSUNMetaLab\Authentication\Providers\UserProviderLDAP,
					App::make('session.store'));
			});
			Auth::extend('dbauth', function() {
				return new Guard(new \CSUNMetaLab\Authentication\Providers\UserProviderDB,
					App::make('session.store'));
			});
		}
	}
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')
            );
        });
    }
1123574
public function register()
    {
        $this->app->register(ScaffoldInterfaceEventServiceProvider::class);

        $this->app->singleton('laravelRequest', \Illuminate\Http\Request::class);

        $this->app->singleton('Request', \Amranidev\ScaffoldInterface\Http\Request::class);

        $this->app->singleton('Scaffold', \Amranidev\ScaffoldInterface\Scaffold::class);

        $this->app->singleton('Datasystem', function ($app) {
            return new \Amranidev\ScaffoldInterface\Datasystem\Datasystem($app->make('Request')->getRequest());
        });

        $this->app->singleton('Parser', function ($app) {
            return new \Amranidev\ScaffoldInterface\Parsers\Parser($app->make('Request')->getRequest());
        });

        $this->app->singleton('Indenter', \Gajus\Dindent\Indenter::class);

        $this->app->singleton('Path', \Amranidev\ScaffoldInterface\Filesystem\Path::class);

        $this->app->singleton('Generator', \Amranidev\ScaffoldInterface\Generators\Generator::class);

        $this->app->singleton('ModelGenerate', \Amranidev\ScaffoldInterface\Generators\ModelGenerate::class);

        $this->app->singleton('ViewGenerate', \Amranidev\ScaffoldInterface\Generators\ViewGenerate::class);

        $this->app->singleton('MigrationGenerate', \Amranidev\ScaffoldInterface\Generators\MigrationGenerate::class);

        $this->app->singleton('ControllerGenerate', \Amranidev\ScaffoldInterface\Generators\ControllerGenerate::class);

        $this->app->singleton('RouteGenerate', \Amranidev\ScaffoldInterface\Generators\RouteGenerate::class);
    }
613042
public function register()
    {

        $app = $this->app;

        foreach ($app->getProviders() as $provider) {

            $provider = new $provider($app);

            if (!$provider instanceof ServiceProvider) {
                throw new ProviderException(sprintf('Your %s proiver must be a instance of ServiceProvider', get_class($provider)));
            }


            $provider->register();

            $app = $provider->app();
        }
    }
1018996
public function register() {

		// Version specific registering
		if ($this->version() == 5) $this->registerLaravel5();

		// Determine the cache dir
		$cache_dir = storage_path($this->version() == 5 ? '/framework/views' : '/views');

		// Bind the package-configred MtHaml instance
		$this->app->singleton('laravel-haml.mthaml', function($app) {
			$config = $this->getConfig();
			return new MtHaml\Environment($config['mthaml']['environment'], 
				$config['mthaml']['options'], 
				$config['mthaml']['filters']);
		});

		// Bind the Haml compiler
		$this->app->singleton('Bkwld\LaravelHaml\HamlCompiler', function($app) use ($cache_dir) {
			return new HamlCompiler($app['laravel-haml.mthaml'], $app['files'], $cache_dir);
		});

		// Bind the Haml Blade compiler
		$this->app->singleton('Bkwld\LaravelHaml\HamlBladeCompiler', function($app) use ($cache_dir) {
			return new HamlBladeCompiler($app['laravel-haml.mthaml'], $app['files'], $cache_dir);
		});

	}
1169843
public function register()
    {
        $packageNamespace = $this->isLaravel4() ? 'laravel-analytics::' : '';

        $this->app->singleton('Ipunkt\LaravelAnalytics\Contracts\AnalyticsProviderInterface', function () use ($packageNamespace) {

            //	get analytics provider name
            $provider = Config::get($packageNamespace . 'analytics.provider');

            //	make it a class
            $providerClass = 'Ipunkt\LaravelAnalytics\Providers\\' . $provider;

            //	getting the config
            $providerConfig = [];
            if (Config::has($packageNamespace . 'analytics.configurations.' . $provider)) {
                $providerConfig = Config::get($packageNamespace . 'analytics.configurations.' . $provider);
            }

            //	make provider instance
            $instance = new $providerClass($providerConfig);

            //	check if we want to prematurely disable the script block
            if (Config::get($packageNamespace . 'analytics.disable_script_block', false)) {
                $instance->disableScriptBlock();
            }

            //	return the provider instance
            return $instance;
        });
    }
209975
public function register()
    {
        include __DIR__ . '/helpers.php';
        include __DIR__ . '/routes/routes.php';

        $this->app->singleton('Notify', function () {
            return new LaranotifyService();
        });

        $this->app->bind('LNConfig', function () {
            return new Configurator();
        });

        $this->app->bind('Laranotify', function () {
            return new LaranotifyService();
        });
    }
708137
protected function registerServices()
    {
        $this->app->singleton('hashid', function ($app) {
            return new HashidManager($app);
        });
        $this->app->alias('hashid', HashidManager::class);

        foreach ($this->getSingletonDrivers() as $class) {
            $this->app->singleton(
                $key = $this->getBindingKeyForDriver($class),
                function () use ($class) {
                    return new $class;
                }
            );
            $this->app->alias($key, $class);
        }

        foreach ($this->getNonSingletonDrivers() as $class) {
            $this->app->bind($this->getBindingKeyForDriver($class), $class);
        }
    }
861353
private function getProvider()
    {
        if (version_compare(\Illuminate\Foundation\Application::VERSION, '5.0', '<')) {
            $provider = 'Larabookir\Gateway\GatewayServiceProviderLaravel4';
        } else {
            $provider = 'Larabookir\Gateway\GatewayServiceProviderLaravel5';
        }

        return new $provider($this->app);
    }
998596
private function registerSocialProviderManager()
    {
        $this->app->singleton(\Acacha\LaravelSocial\Contracts\Factory::class, function ($app) {
            return new SocialProviderManager($app);
        });
    }
1002833
public function registerProvider($provider)
    {
        if (($provider = $this->getProvider($provider))) {
        } elseif (is_string($provider)) {
            $provider = $this->resolveProvider($provider);
        }

        if ($this->registeredProvider($provider)) {
            return $provider;
        }

        if (method_exists($provider, 'register')) {
            $provider->register();
        }

        $this->markAsRegistered($provider);

        // If the application has already booted, we will call this boot method on
        // the provider class so it has an opportunity to do its boot logic and
        // will be ready for any usage by this developer's application logic.
        if ($this->booted) {
            $this->bootProvider($provider);
        }
        return $provider;
    }
39158
public function register()
    {
        $this->app->bind(Northstar::class, function ($app) {
            $client = new LaravelNorthstar(config('services.northstar'));
            $client->setLogger($app['log']);

            return $client;
        });

        $this->app->bind(Blink::class, function ($app) {
            $client = new Blink(config('services.blink'));
            $client->setLogger($app['log']);

            return $client;
        });

        $this->app->bind(Gladiator::class, function ($app) {
            $client = new Gladiator(config('services.gladiator'));
            $client->setLogger($app['log']);

            return $client;
        });

        // Set alias for requesting from app() helper.
        $this->app->alias(Northstar::class, 'gateway.northstar');
        $this->app->alias(Blink::class, 'gateway.blink');
        $this->app->alias(Gladiator::class, 'gateway.gladiator');

        // Backwards-compatibility.
        $this->app->alias(Northstar::class, 'northstar');

        // Register token validator w/ config dependency.
        $this->app->bind(Token::class, function ($app) {
            $key = config('auth.providers.northstar.key');

            // If not set, check old suggested config location:
            if (! $key) {
                $key = config('services.northstar.key');
            }

            return new Token(new LaravelRequestHandler(), $key);
        });

        // Register custom Gateway authentication guard.
        Auth::extend('gateway', function ($app, $name, array $config) {
            $provider = Auth::createUserProvider($config['provider']);

            return new GatewayGuard($provider, $app[Request::class]);
        });

        // Register custom Gateway user provider.
        Auth::provider('gateway', function ($app, array $config) {
            return new GatewayUserProvider();
        });
    }
324761
protected function registerProviders()
    {
        // register rollbar service provider
        if (class_exists(HCRollbarServiceProvider::class))
            $this->app->register(HCRollbarServiceProvider::class);

        // register LogViewer service provider
        if (class_exists(LaravelLogViewerServiceProvider::class))
            $this->app->register(LaravelLogViewerServiceProvider::class);
    }