public function registerMiddlewareBindings(Application $app)
    {
        $app->singleton(CheckAuthCodeRequestMiddleware::class, function ($app) {
            return new CheckAuthCodeRequestMiddleware($app['oauth2-server.authorizer']);
        });

        $app->singleton(OAuthMiddleware::class, function ($app) {
            $httpHeadersOnly = $app['config']->get('oauth2.http_headers_only');

            return new OAuthMiddleware($app['oauth2-server.authorizer'], $httpHeadersOnly);
        });

        $app->singleton(OAuthClientOwnerMiddleware::class, function ($app) {
            return new OAuthClientOwnerMiddleware($app['oauth2-server.authorizer']);
        });

        $app->singleton(OAuthUserOwnerMiddleware::class, function ($app) {
            return new OAuthUserOwnerMiddleware($app['oauth2-server.authorizer']);
        });
    }
public function registerMiddlewareBindings(Application $app)
    {
        $app->singleton(CheckAuthCodeRequestMiddleware::class, function ($app) {
            return new CheckAuthCodeRequestMiddleware($app['oauth2-server.authorizer']);
        });

        $app->singleton(OAuthMiddleware::class, function ($app) {
            $httpHeadersOnly = $app['config']->get('oauth2.http_headers_only');

            return new OAuthMiddleware($app['oauth2-server.authorizer'], $httpHeadersOnly);
        });

        $app->singleton(OAuthClientOwnerMiddleware::class, function ($app) {
            return new OAuthClientOwnerMiddleware($app['oauth2-server.authorizer']);
        });

        $app->singleton(OAuthUserOwnerMiddleware::class, function ($app) {
            return new OAuthUserOwnerMiddleware($app['oauth2-server.authorizer']);
        });
    }
public function registerMiddlewareBindings ( Application $ app ) { $ app -> singleton ( CheckAuthCodeRequestMiddleware :: class , function ( $ app ) { return new CheckAuthCodeRequestMiddleware ( $ app [ 'oauth2-server.authorizer' ] ) ; } ) ; $ app -> singleton ( OAuthMiddleware :: class , function ( $ app ) { $ httpHeadersOnly = $ app [ 'config' ] -> get ( 'oauth2.http_headers_only' ) ; return new OAuthMiddleware ( $ app [ 'oauth2-server.authorizer' ] , $ httpHeadersOnly ) ; } ) ; $ app -> singleton ( OAuthClientOwnerMiddleware :: class , function ( $ app ) { return new OAuthClientOwnerMiddleware ( $ app [ 'oauth2-server.authorizer' ] ) ; } ) ; $ app -> singleton ( OAuthUserOwnerMiddleware :: class , function ( $ app ) { return new OAuthUserOwnerMiddleware ( $ app [ 'oauth2-server.authorizer' ] ) ; } ) ; }
Register the Middleware to the IoC container because
some middleware need additional parameters.

@param \Illuminate\Contracts\Container\Container $app

@return void
Register the Middleware to the IoC container because some middleware need additional parameters .