Substitute the implicit Eloquent model bindings for the route.

@param  Route $route
972092
protected function substituteImplicitBindings( $route )
	{
		$parameters = $route->parameters();

		foreach ( $route->signatureParameters( Model::class ) as $parameter )
		{
			$class = $parameter->getClass();

			if ( array_key_exists( $parameter->name, $parameters ) && !$route->getParameter( $parameter->name ) instanceof Model )
			{
				$method = $parameter->isDefaultValueAvailable() ? 'first' : 'firstOrFail';

				$model = $class->newInstance();

				$route->setParameter( $parameter->name, $model->where( $model->getRouteKeyName(), $parameters[$parameter->name] )->{$method()} );
			}
		}
	}
405482
public function route($route = null)
    {
        if (null === $route) {
            return $this->route;
        }
        $this->route = $route;

        return $this;
    }
525681
protected function addWhereClausesToRoute($route)
    {
        $patterns = \app(\Illuminate\Routing\Router::class)->getPatterns();

        $route->where(\array_merge(
            $patterns, $route->getAction()['where'] ?? []
        ));

        return $route;
    }
1127051
protected function addToCollections($route)
	{
		$domainAndUri = $route->domain() . $route->getUri();

		foreach ($route->methods() as $method)
		{
			$this->routes[$method][$domainAndUri] = $route;
		}

		$this->allRoutes[$method . $domainAndUri] = $route;
	}
1230709
public function activateOnRoute(string $route)
    {
        $this->activeWhen = function () use ($route) {
            return str_contains(Route::currentRouteName(), $route);
        };

        return $this;
    }
150672
public function route($route, $prefix = null)
    {
        $this->route = substr($route, strlen($prefix));
        $parameters = [];

        // Go through predefined routes till a match is found
        foreach ($this->routeOrder as $routeName) {
            $routeDescription = $this->routes[$routeName];
            $parameters = $this->match($this->route, $routeDescription);
            if ($parameters !== false) {
                return [
                    'route' => $this->route,
                    'parameters' => $this->fillInDefaultParameters($routeDescription, $parameters),
                    'description' => $routeDescription
                ];
            }
        }
        return [
            'route' => $this->route,
            'parameters' => $parameters,
            'description' => $this->routes['default']
        ];
    }
7705
protected function callAttachedBefores($route, $request)
	{
		foreach ($route->beforeFilters() as $filter => $parameters)
		{
			$response = $this->callRouteFilter($filter, $parameters, $route, $request);

			if ( ! is_null($response)) return $response;
		}
	}
1049098
private function target(Route $route)
    {
        $params = $route->getParams();

        $target = new Target($params['controller']);

        unset($params['controller']);

        if (isset($params['action'])) {
            $target->setAction($params['action']);
            unset($params['action']);
        }

        $target->setParams($params);

        return $target;
    }
821050
public static function resolveForRoute($container, $route)
    {
        $parameters = $route->parameters();

        foreach ($route->signatureParameters(UrlRoutable::class) as $parameter) {
            if (! $parameterName = static::getParameterName($parameter->name, $parameters)) {
                continue;
            }

            $parameterValue = $parameters[$parameterName];

            if ($parameterValue instanceof UrlRoutable) {
                continue;
            }

            $instance = $container->make($parameter->getClass()->name);

            if (! $model = $instance->resolveRouteBinding($parameterValue)) {
                throw (new ModelNotFoundException)->setModel(get_class($instance));
            }

            $route->setParameter($parameterName, $model);
        }
    }
1242534
protected function compile($route)
    {
        if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                list($block, $pre, $type, $param, $optional) = $match;

                if (isset($this->_match_types[$type])) {
                    $type = $this->_match_types[$type];
                }
                if ($pre === '.') {
                    $pre = '\.';
                }

                //Older versions of PCRE require the 'P' in (?P<named>)
                $pattern = '(?:'
                    .($pre !== '' ? $pre : null)
                    .'('
                    .($param !== '' ? "?P<$param>" : null)
                    .$type
                    .'))'
                    .($optional !== '' ? '?' : null);

                $route = str_replace($block, $pattern, $route);
            }
        }

        return "`^$route$`u";
    }
841530
private function signatureParameters(Route $route)
    {
        return collect($route->signatureParameters())
            ->reject(function (ReflectionParameter $parameter) use ($route) {
                return !array_key_exists($parameter->name, $route->parameters());
            })
            ->reject(function (ReflectionParameter $parameter) {
                return !$parameter->getClass();
            })->toArray();
    }
799988
protected function appendGroupInfo(Route $route): void
    {
        $path = $bak = $route->getPath();

        // Always add '/' prefix.
        $path = \strpos($path, '/') === 0 ? $path : '/' . $path;
        $path = $this->currentGroupPrefix . $path;

        // Has setting 'ignoreLastSlash'
        if ($path !== '/' && $this->ignoreLastSlash) {
            $path = \rtrim($path, '/');
        }

        // Not in group and path not change.
        if ($bak === $path) {
            return;
        }

        $route->setPath($path);

        // Not in group
        if (!$this->currentGroupPrefix) {
            return;
        }

        if ($this->currentGroupOption) {
            $route->setOptions(\array_merge($this->currentGroupOption, $route->getOptions()));
        }

        // Prepend group middleware at before.
        if ($this->currentGroupChains) {
            $route->setChains(\array_merge($this->currentGroupChains, $route->getChains()));
        }
    }
695529
public function add(Route $route)
    {
        $this->addRoute($route->methods(), $route->uri(), $route->handler(), $route->name());
    }
433932
private static function runRouteMiddleware($route)
    {
        $routeMiddleware = Filter::$routeMiddleware;

        if (!is_null($route->getMiddleware())) {
            // if ($route->getMiddleware()['type'] == 'route' && ! is_null($route->getMiddleware()['middlewares'])) {
            foreach ($route->getMiddleware() as $middleware) {
                //Check if the routes middlewares are in filter class
                exception_if(!array_has($routeMiddleware, $middleware), RouteMiddlewareNotFoundException::class, $middleware);

                $middleware = instance($routeMiddleware[$middleware]);

                $middleware->handle(new Request());
            }
        }

        return true;
    }
1366925
public function config($route) {
		$this->registry->get('event')->trigger('config/' . $route . '/before', array(&$route));

		$this->registry->get('config')->load($route);

		$this->registry->get('event')->trigger('config/' . $route . '/after', array(&$route));
	}
481518
protected function setFoundMiddleware(Route $route) : void
    {
        if (is_null($route->getStrategy())) {
            $route->setStrategy($this->getStrategy());
        }

        // wrap entire dispatch process in exception handler
        $this->prependMiddleware($route->getStrategy()->getExceptionHandler());

        // add group and route specific middleware
        if ($group = $route->getParentGroup()) {
            $this->middlewares($group->getMiddlewareStack());
        }

        $this->middlewares($route->getMiddlewareStack());

        // add actual route to end of stack
        $this->middleware($route);
    }
499720
private function trackRoutePathParameters(Route $route, Models\RoutePath $routePath)
    {
        $parameters = [];

        if ($route->hasParameters()) {
            foreach ($route->parameters() as $parameter => $value) {
                $parameters[] = $this->makeModel(BindingManager::MODEL_ROUTE_PATH_PARAMETER)->fill([
                    'parameter' => $parameter,
                    'value'     => $this->checkIfValueIsEloquentModel($value),
                ]);
            }
        }

        if (count($parameters) > 0)
            $routePath->parameters()->saveMany($parameters);
    }