src/Slushie/Middleware/Loader.php
protected function registerMiddleware() {
    $middleware = $this->app['config']['app.middleware'];

    foreach ($middleware as $class_name) {
      $filter = app($class_name);
      if ($filter instanceof BeforeInterface) {
        array_push($this->before, $filter);
      }
      if ($filter instanceof AfterInterface) {
        array_push($this->after, $filter);
      }
    }
  }
protected function registerMiddleware() {
    $middleware = $this->app['config']['app.middleware'];

    foreach ($middleware as $class_name) {
      $filter = app($class_name);
      if ($filter instanceof BeforeInterface) {
        array_push($this->before, $filter);
      }
      if ($filter instanceof AfterInterface) {
        array_push($this->after, $filter);
      }
    }
  }
protected function registerMiddleware ( ) { $ middleware = $ this -> app [ 'config' ] [ 'app.middleware' ] ; foreach ( $ middleware as $ class_name ) { $ filter = app ( $ class_name ) ; if ( $ filter instanceof BeforeInterface ) { array_push ( $ this -> before , $ filter ) ; } if ( $ filter instanceof AfterInterface ) { array_push ( $ this -> after , $ filter ) ; } } }
Create middleware instances from the array of
class names in the "app.middleware" config key.
Create middleware instances from the array of class names in the app . middleware config key .