Skip to content

Commit

Permalink
Method bindingFieldFor did not exist before L7
Browse files Browse the repository at this point in the history
See #42
  • Loading branch information
lorisleiva committed May 21, 2020
1 parent 478b5e6 commit 9fa5ac4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Concerns/ResolvesMethodDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function resolveContainerDependency($class, $key, $value)
protected function resolveRouteBinding($instance, $key, $value)
{
$route = $this->runningAs('controller') ? $this->request->route() : null;
$field = optional($route)->bindingFieldFor($key);
$field = $route && method_exists($route, 'bindingFieldFor') ? $route->bindingFieldFor($key) : null;
$parent = $route && method_exists($route, 'parentOfParameter') ? $route->parentOfParameter($key) : null;

if ($parent && $field && $parent instanceof UrlRoutable) {
Expand Down

0 comments on commit 9fa5ac4

Please sign in to comment.