src/Router.php
public function runRouteMiddleware($middleware, $type)
    {
        $middlewarePath = $this->baseFolder . '/' . $this->paths['middlewares'];
        $middlewareNs = $this->namespaces['middlewares'];
        if ($type == 'before') {
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
        } else {
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
        }
    }
public function runRouteMiddleware($middleware, $type)
    {
        $middlewarePath = $this->baseFolder . '/' . $this->paths['middlewares'];
        $middlewareNs = $this->namespaces['middlewares'];
        if ($type == 'before') {
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
        } else {
            $this->routerCommand()->beforeAfter(
                $middleware[$type], $middlewarePath, $middlewareNs
            );
            if (! is_null($middleware['group'])) {
                $this->routerCommand()->beforeAfter(
                    $middleware['group'][$type], $middlewarePath, $middlewareNs
                );
            }
        }
    }
public function runRouteMiddleware ( $ middleware , $ type ) { $ middlewarePath = $ this -> baseFolder . '/' . $ this -> paths [ 'middlewares' ] ; $ middlewareNs = $ this -> namespaces [ 'middlewares' ] ; if ( $ type == 'before' ) { if ( ! is_null ( $ middleware [ 'group' ] ) ) { $ this -> routerCommand ( ) -> beforeAfter ( $ middleware [ 'group' ] [ $ type ] , $ middlewarePath , $ middlewareNs ) ; } $ this -> routerCommand ( ) -> beforeAfter ( $ middleware [ $ type ] , $ middlewarePath , $ middlewareNs ) ; } else { $ this -> routerCommand ( ) -> beforeAfter ( $ middleware [ $ type ] , $ middlewarePath , $ middlewareNs ) ; if ( ! is_null ( $ middleware [ 'group' ] ) ) { $ this -> routerCommand ( ) -> beforeAfter ( $ middleware [ 'group' ] [ $ type ] , $ middlewarePath , $ middlewareNs ) ; } } }
Detect Routes Middleware; before or after

@param $middleware
@param $type

@return void
Detect Routes Middleware ; before or after