Alias the middleware.

@return void
547691
protected function aliasMiddleware()
    {
        $router = $this->app['router'];

        $method = method_exists($router, 'aliasMiddleware') ? 'aliasMiddleware' : 'middleware';

        $router->$method('sv.auth', PlatformAuthenticate::class);
    }
968610
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {
            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('history', 'ApiController@index')->middleware('can:see-history');
                    $router->delete('history', 'ApiController@destroy')->middleware('can:clear-history');
                });
            });
        });
    }
355833
public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {

            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('dashboard', 'AdminController@dashboard')->name('dashboard')->middleware('can:see-dashboard');
                $router->get('', 'AdminController@index')->middleware('can:see-dashboard');
            });
        });
    }
670614
public function setupMiddleware()
    {
        $this->middleware('antares.auth');
        $this->middleware('antares.can:antares/translations::add-language', ['only' => ['create'],]);
        $this->middleware('antares.can:antares/translations::publish-translations', ['only' => ['publish'],]);
        $this->middleware('antares.can:antares/translations::export-translations', ['only' => ['export'],]);
        $this->middleware('antares.can:antares/translations::import-translations', ['only' => ['import'],]);
        $this->middleware('antares.can:antares/translations::change-language', ['only' => ['change'],]);
    }
632655
protected function registerClassAliases()
    {
        $aliases = __config()->class_aliases;
        if (!empty($aliases)) {
            $aliasLoader = new AliasLoader($aliases);
            spl_autoload_register([$aliasLoader, 'load']);
        }
    }
41322
public function add()
	{
		// Get the alias we're setting
		$name = $this->arguments->getOpt(3);
		$path = $this->arguments->getOpt(4);

		// Delete the primary args so they aren't added as top level config values
		$this->arguments->deleteOpt(3);
		$this->arguments->deleteOpt(4);

		// Set the new aliases argument
		$this->arguments->setOpt('aliases', array($name => $path));

		// Redirect back to the basic configuration set method
		App::get('client')->call('configuration', 'set', $this->arguments, $this->output);
	}
1034023
public function runAfter()
    {
        foreach ($this->running as $key => $middleware) {
            /* @var $middleware MiddlewareAbstract */
            $middleware->onAfter();
            unset($this->running[$key]);
        }

        return;
    }
763280
public function pipe(Middleware $middleware, string $alias = ''): App
    {
        $alias = $alias ? $alias : $middleware->alias();
        if (isset($this->pipe[$alias])) {
            throw new SimplesAlreadyRegisteredError("The middleware `{$alias}` is already registered");
        }
        $this->pipe[$alias] = $middleware;

        return $this;
    }
897373
public function middleware($middleware = null)
    {
        if (is_null($middleware)) {
            return (array) ($this->action['middleware'] ?? []);
        }

        if (is_string($middleware)) {
            $middleware = func_get_args();
        }

        $this->action['middleware'] = array_merge(
            (array) ($this->action['middleware'] ?? []), $middleware
        );

        return $this;
    }
880385
private function registerApiMiddleware()
    {
        /** @var  \Illuminate\Contracts\Config\Repository  $config */
        $config = $this->app['config'];

        foreach ($config->get('api-helper.middleware', []) as $name => $class) {
            $this->aliasMiddleware($name, $class);
        };
    }
1030732
public function use($middlewares) {
		$middlewares = (array)$middlewares;

		if ($this->namespace) {
			foreach ($middlewares as &$middleware) {
				$middleware = $this->namespace . $middleware;
			}
		}

		$this->middlewares = array_merge($this->middlewares, (array)$middlewares);

		return $this;
	}
221299
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);
      }
    }
  }
1172263
protected function registerApiRouteMiddleware()
    {
        foreach ($this->getApiRouteMiddleware() as $key => $middleware) {
            $this->router->aliasMiddleware($key, $middleware);
        }

        return $this;
    }
491378
protected function loadMiddleware()
    {
        $middlewareLoader = new MiddlewareLoader($this->getClassLoader());
        $middlewareLoader->initialize();

        $this->setConfig("runtime.middlewares", $middlewareLoader->getMiddlewares());
    }
694225
protected function routes()
    {
        if ($this->app->routesAreCached()) {
            return;
        }

        Route::middleware(['nova', 'api', Authorize::class])
            ->prefix('nova-vendor/spatie/nova-tags-field')
            ->group(__DIR__.'/../routes/api.php');
    }
1193825
public function pipe($middlewares): self
    {
        //Add middleware to the end of the stack => Append
        //array_push($this->middlewares, $this->decorate($middleware));

        if (! is_array($middlewares)) {
            $middlewares = [$middlewares];
        }

        foreach ($middlewares as $middleware) {
            $this->middlewares[] = $this->decorate($middleware);
        }

        return $this;
    }
814799
protected function setupMiddleware() {
        $this->middleware('antares.auth');
        $this->middleware('antares.manage');
        $this->middleware('antares.csrf');

        $this->canMiddleware('install');
        $this->canMiddleware('uninstall');
        $this->canMiddleware('activate');
        $this->canMiddleware('deactivate');
    }