protected function getRoutePathParameters($route)
	{
		$parameters = [];

		$routeAction = $route->getAction();
		list($class, $method) = explode('@', $routeAction['uses']);

		$reflection = new ReflectionClass($class);
		$reflectionMethod = $reflection->getMethod($method);

		foreach ($reflectionMethod->getParameters() as $parameter) {
			$reflectionType = $parameter->getType();
			// Only scalar types or undefined types
			if (is_null($reflectionType) || $reflectionType->isBuiltin()) {
				$parameters[$parameter->getName()] = [
					'name' => $parameter->getName(),
				];
				if (!is_null($reflectionType) && $reflectionType->isBuiltin()) {
					$parameters[$parameter->getName()]['type'] = (string)$parameter->getType();
				}
			}
		}

		if (count($parameters) > 0) {
			// Inject the related phpdoc if exists.
			$comment = $reflectionMethod->getDocComment();
			if ($comment) {
				$docBlock = $this->docBlockFactory->create($comment);
				foreach ($docBlock->getTagsByName('param') as $tag) {
					foreach ($parameters as $parameterName => $parameter) {
						if ($tag->getVariableName() == $parameterName) {
							$docDescription = $tag->getDescription()->render();
							/** @var \ReflectionType $reflectionType */
							$reflectionType = $tag->getType();
							$parameters[$parameterName]['docType'] = (string)$reflectionType;
							$parameters[$parameterName]['docDescription'] = $docDescription;
						}
					}
				}
			}
		}

		return $parameters;
	}
protected function getRoutePathParameters($route)
	{
		$parameters = [];

		$routeAction = $route->getAction();
		list($class, $method) = explode('@', $routeAction['uses']);

		$reflection = new ReflectionClass($class);
		$reflectionMethod = $reflection->getMethod($method);

		foreach ($reflectionMethod->getParameters() as $parameter) {
			$reflectionType = $parameter->getType();
			// Only scalar types or undefined types
			if (is_null($reflectionType) || $reflectionType->isBuiltin()) {
				$parameters[$parameter->getName()] = [
					'name' => $parameter->getName(),
				];
				if (!is_null($reflectionType) && $reflectionType->isBuiltin()) {
					$parameters[$parameter->getName()]['type'] = (string)$parameter->getType();
				}
			}
		}

		if (count($parameters) > 0) {
			// Inject the related phpdoc if exists.
			$comment = $reflectionMethod->getDocComment();
			if ($comment) {
				$docBlock = $this->docBlockFactory->create($comment);
				foreach ($docBlock->getTagsByName('param') as $tag) {
					foreach ($parameters as $parameterName => $parameter) {
						if ($tag->getVariableName() == $parameterName) {
							$docDescription = $tag->getDescription()->render();
							/** @var \ReflectionType $reflectionType */
							$reflectionType = $tag->getType();
							$parameters[$parameterName]['docType'] = (string)$reflectionType;
							$parameters[$parameterName]['docDescription'] = $docDescription;
						}
					}
				}
			}
		}

		return $parameters;
	}
protected function getRoutePathParameters ( $ route ) { $ parameters = [ ] ; $ routeAction = $ route -> getAction ( ) ; list ( $ class , $ method ) = explode ( '@' , $ routeAction [ 'uses' ] ) ; $ reflection = new ReflectionClass ( $ class ) ; $ reflectionMethod = $ reflection -> getMethod ( $ method ) ; foreach ( $ reflectionMethod -> getParameters ( ) as $ parameter ) { $ reflectionType = $ parameter -> getType ( ) ; // Only scalar types or undefined types
 if ( is_null ( $ reflectionType ) || $ reflectionType -> isBuiltin ( ) ) { $ parameters [ $ parameter -> getName ( ) ] = [ 'name' => $ parameter -> getName ( ) , ] ; if ( ! is_null ( $ reflectionType ) && $ reflectionType -> isBuiltin ( ) ) { $ parameters [ $ parameter -> getName ( ) ] [ 'type' ] = ( string ) $ parameter -> getType ( ) ; } } } if ( count ( $ parameters ) > 0 ) { // Inject the related phpdoc if exists.
 $ comment = $ reflectionMethod -> getDocComment ( ) ; if ( $ comment ) { $ docBlock = $ this -> docBlockFactory -> create ( $ comment ) ; foreach ( $ docBlock -> getTagsByName ( 'param' ) as $ tag ) { foreach ( $ parameters as $ parameterName => $ parameter ) { if ( $ tag -> getVariableName ( ) == $ parameterName ) { $ docDescription = $ tag -> getDescription ( ) -> render ( ) ; /** @var \ReflectionType $reflectionType */ $ reflectionType = $ tag -> getType ( ) ; $ parameters [ $ parameterName ] [ 'docType' ] = ( string ) $ reflectionType ; $ parameters [ $ parameterName ] [ 'docDescription' ] = $ docDescription ; } } } } } return $ parameters ; }
Try to get route method path parameters

@param \Illuminate\Routing\Route $route
@return mixed[]
Try to get route method path parameters