Get the middleware for the route's controller.

@return array
338449
public function controllerMiddleware()
    {
        if (! $this->isControllerAction()) {
            return [];
        }

        return $this->controllerDispatcher()->getMiddleware(
            $this->getController(), $this->getControllerMethod()
        );
    }
586990
public function mapPluginsFrontendRoutes()
    {
        foreach(Plugin::activePlugins() as $plugin){
            // Frontend routes
            $frontendRoutes = $plugin->frontendRoutes();
            if($frontendRoutes) {
                \Route::group(
                    [
                    'middleware' => $this->middleware['frontend'],
                    'as' => $plugin->namespaceWithDot().".",
                    'namespace' => $plugin->parseNamespace().'\Controllers',
                    ], function () use ($frontendRoutes) {
                        foreach($frontendRoutes as $file){
                            include $file->getPathname();
                        }
                    }
                );
            }
        }
        return $this;
    }
748172
public function getMiddlewares(array $middlewares = []) : array
	{
		return $this->parent ? 
			$this->parent->getMiddlewares(array_merge($middlewares, $this->middlewares)) :
			array_merge($middlewares, $this->middlewares);
	}
497070
protected function controllerMiddleware()
	{
		list( $class, $method ) = explode( '@', $this->action['uses'] );

		$controller = UniversalBuilder::resolve( $class );

		return ( new ControllerDispatcher( $this->router ) )->getMiddleware( $controller, $method );
	}
1087499
protected function _getController()
    {
        $controller = parent::_getController();
        $cors = new CorsMiddleware();
        $controller->response = $cors(
            $controller->request, $controller->response,
            function($request, $response){ return $response; }
        );
        return $controller;
    }
876983
public function getController() {
        $router = new Router($this);
        $router->setCurrentRoute();
        $controllerObject = $this->GetControllerObject($router);
        $this->controller = $controllerObject;
        return $controllerObject;
    }
124581
protected function getController()
    {
        list($class) = explode('@', $this->action['uses']);
        if (!$this->controller) {
            $this->controller = $this->container->make($class);
        }

        return $this->controller;
    }
789252
public function gatherRouteMiddlewares(LaravelRoute $route)
    {
        $middlewares = [];

        foreach ($route->middleware() as $name) {
            $middlewares[] = $this->resolveMiddlewareClassName($name);
        }
        return Arr::flatten($middlewares);
    }
980186
protected function getControllerMiddlewareFromInstance($controller, $method)
    {
        $middlewares = $this->router->getMiddleware();

        //
        $results = array();

        foreach ($controller->getMiddleware() as $middleware => $options) {
            if (ControllerDispatcher::methodExcludedByOptions($method, $options)) {
                continue;
            }

            list($name, $parameters) = array_pad(explode(':', $middleware, 2), 2, null);

            $middleware = Arr::get($middlewares, $name, $name);

            $results[] = (! $middleware instanceof Closure) ? $middleware : $name;
        }

        return $results;
    }
995517
public function getRoutes()
    {
        $out = [];
        foreach($this->routes as $route) {
            $out[] = $route;
        }

        foreach ($this->children as $child) {
            foreach ($child->getRoutes() as $route) {
                $out[] = $route;
            }
        }

        return $out;
    }
742358
public function getAuthRoutes()
    {
        $menu = $this->getMenu();
         
        if (!$menu) {
            return $this->extendPermissionRoutes();
        }
        
        return ArrayHelper::merge($this->extendPermissionRoutes(), $menu->getPermissionRoutes());
    }
178779
protected function getControllerMiddlewareFromInstance($controller, $method)
    {
        $middleware = $this->router->getMiddleware();

        $results = [];

        foreach ($controller->getMiddleware() as $name => $options) {
            if (!$this->methodExcludedByOptions($method, $options)) {
                $results[$name] = array_get($middleware, $name, $name);
            }
        }

        return $results;
    }
1241323
public function mapPluginsBackendRoutes()
    {
        foreach(Plugin::activePlugins() as $plugin){
            $backendRoutes = $plugin->backendRoutes();
            if($backendRoutes) {
                \Route::group(
                    [
                    'middleware' => $this->middleware['backend'],
                    'as' => 'Backend.'.$plugin->namespaceWithDot().".",
                    'namespace' => $plugin->parseNamespace().'\Controllers',
                    'prefix' => Config::get('project')['adminPrefix']."/".$plugin->backendURLPrefix()
                    ], function () use ($backendRoutes) {
                        foreach($backendRoutes as $file){
                            include $file->getPathname();
                        }
                    }
                );
            }
        }
        return $this;
    }
661930
public static function routes()
    {
        $middleware = [ CreateDefaultFolder::class, MultiUser::class ];
        $as = 'unisharp.lfm.';
        $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';

        Route::group(compact('middleware', 'as', 'namespace'), function () {

            // display main layout
            Route::get('/', [
                'uses' => 'LfmController@show',
                'as' => 'show',
            ]);

            // display integration error messages
            Route::get('/errors', [
                'uses' => 'LfmController@getErrors',
                'as' => 'getErrors',
            ]);

            // upload
            Route::any('/upload', [
                'uses' => 'UploadController@upload',
                'as' => 'upload',
            ]);

            // list images & files
            Route::get('/jsonitems', [
                'uses' => 'ItemsController@getItems',
                'as' => 'getItems',
            ]);

            Route::get('/move', [
                'uses' => 'ItemsController@move',
                'as' => 'move',
            ]);

            Route::get('/domove', [
                'uses' => 'ItemsController@domove',
                'as' => 'domove'
            ]);

            // folders
            Route::get('/newfolder', [
                'uses' => 'FolderController@getAddfolder',
                'as' => 'getAddfolder',
            ]);

            // list folders
            Route::get('/folders', [
                'uses' => 'FolderController@getFolders',
                'as' => 'getFolders',
            ]);

            // crop
            Route::get('/crop', [
                'uses' => 'CropController@getCrop',
                'as' => 'getCrop',
            ]);
            Route::get('/cropimage', [
                'uses' => 'CropController@getCropimage',
                'as' => 'getCropimage',
            ]);
            Route::get('/cropnewimage', [
                'uses' => 'CropController@getNewCropimage',
                'as' => 'getCropimage',
            ]);

            // rename
            Route::get('/rename', [
                'uses' => 'RenameController@getRename',
                'as' => 'getRename',
            ]);

            // scale/resize
            Route::get('/resize', [
                'uses' => 'ResizeController@getResize',
                'as' => 'getResize',
            ]);
            Route::get('/doresize', [
                'uses' => 'ResizeController@performResize',
                'as' => 'performResize',
            ]);

            // download
            Route::get('/download', [
                'uses' => 'DownloadController@getDownload',
                'as' => 'getDownload',
            ]);

            // delete
            Route::get('/delete', [
                'uses' => 'DeleteController@getDelete',
                'as' => 'getDelete',
            ]);

            Route::get('/demo', 'DemoController@index');
        });
    }
1121056
public static function routes()
  {
    Route::group(['namespace' => 'Auth'], function () {

      Route::group(['middleware' => ['guest']], function () {

        Route::get('login', 'LoginController@showLoginPage')->name('showLogin');
        Route::post('login', 'LoginController@login')->name('login');

        Route::get('login/email', 'LoginController@showMagicLinkPage')->name('showMagicLink');
        Route::post('login/email', 'LoginController@loginWithEmail')->name('loginWithEmail');
        Route::get('login/callback/email/', 'LoginController@loginEmailCallback')->name('loginCallback');

        Route::get('register', 'RegisterController@showRegistrationPage')->name('showRegistration');
        Route::post('register', 'RegisterController@register')->name('register');

        Route::get('password/forgot', 'ForgotPasswordController@showForgotPasswordPage')->name('showForgotPassword');
        Route::post('password/forgot', 'ForgotPasswordController@forgot')->name('forgot');

        Route::get('password/reset', 'ForgotPasswordController@showResetPasswordPage')->name('showResetPassword');
        Route::post('password/reset', 'ForgotPasswordController@resetPassword')->name('resetPassword');

      });

      Route::get('logout', 'LoginController@logout')->name('logout')->middleware('private', 'auth');
      Route::get('account/verify', 'RegisterController@verifyEmail')->name('verify');

    });
  }
291414
public static function getMiddleware($controller, $method)
    {
        if (! method_exists($controller, 'getMiddleware')) {
            return array();
        }

        $results = array();

        foreach ($controller->getMiddleware() as $middleware => $options) {
            if (static::methodExcludedByOptions($method, $options)) {
                continue;
            }

            $results[] = $middleware;
        }

        return $results;
    }
1141437
public function getControllers()
    {
        $map = $this->map;
        $result = array();

        foreach ($map as $template => $options) {
            if (isset($options['controller'])) {
                $result[] = $options['controller'];
            }
        }

        return $result;
    }