We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd1c9ba commit bdb4e99Copy full SHA for bdb4e99
src/Http/Api/Contracts/HasParser.php
@@ -56,14 +56,15 @@ protected function filterByParent(): array
56
$param = reset($parent);
57
}else{
58
$key = strtolower(class_basename($parent));
59
+ $param = $key;
60
}
61
- $routeRelation = $this->request->route()->parameter($key);
62
+ $routeRelation = $this->request->route()->parameter($param);
63
64
$child = resolve($this->model());
65
66
if(!$routeRelation instanceof Model){
- $bindingField = $this->request->route()->bindingFieldFor($key) ?? $child->{$key}()->getRelated()->getKeyName();
67
+ $bindingField = $this->request->route()->bindingFieldFor($param) ?? $child->{$key}()->getRelated()->getKeyName();
68
$routeRelation = $child->{$key}()->getRelated()->where($bindingField, $routeRelation)->firstOrFail();
69
70
0 commit comments