lumen-framework: Can't call parameter on routeResolver array

Trying to read route parameters from my Middleware class with $request->route(‘id’). This gives me the error that it can’t call parameter() on an array. When I look at the source code, the $this->getRouteResolver() returns an array. Is this a bug?

public function route($param = null)
{
  $route = call_user_func($this->getRouteResolver());

  if (is_null($route) || is_null($param)) {
    return $route;
  } else {
    return $route->parameter($param);
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 5
  • Comments: 21 (5 by maintainers)

Most upvoted comments

Should be fixed in 5.7. Feel free to reply if you’re still experiencing it in 5.7.

@SPRING-Z The PR I had sent got closed. They don’t fix the issue nor accept the PR. So no hope!