示例#1
0
 /**
  * Register the middleware.
  *
  * @return void
  */
 protected function registerMiddleware()
 {
     $this->app->singleton('api.response', function ($app) {
         return new Response();
     });
     $this->app->singleton('Api\\RequestHandler', function ($app) {
         return new RequestHandler($app, $app['api.exception'], $app['api.router'], $app['api.http.validator']);
     });
     $this->app->singleton('Sunel\\Api\\Http\\Middleware\\Auth', function ($app) {
         return new Middleware\Auth($app['api.router'], $app['api.auth']);
     });
     $this->app->singleton('Sunel\\Api\\Http\\Middleware\\Tokenized', function ($app) {
         return new Middleware\Tokenized(new TokenParser());
     });
 }
示例#2
0
 /**
  * Register the auth providers.
  *
  * @return void
  */
 protected function registerAuth()
 {
     $this->app->singleton('Sunel\\Api\\Auth\\JWTAuth', function ($app) {
         return new JWTAuth(\Mage::helper('api3/auth'));
     });
 }