|
@@ 86-93 (lines=8) @@
|
| 83 |
|
* |
| 84 |
|
* @return \Illuminate\Routing\Route |
| 85 |
|
*/ |
| 86 |
|
protected function addRelationshipShow($name, $base, array $relationships, $controller, array $options) |
| 87 |
|
{ |
| 88 |
|
$uri = $this->getRelationshipUri($name, $base); |
| 89 |
|
$action = $this->getResourceAction($name, $controller, 'showRelationship', $options); |
| 90 |
|
|
| 91 |
|
return $this->router->get($uri, $action) |
| 92 |
|
->where('relationship', '(' . implode(')|(', $relationships) . ')'); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
/** |
| 96 |
|
* Add a relationship update method to match named relationships on the resource. |
|
@@ 106-113 (lines=8) @@
|
| 103 |
|
* |
| 104 |
|
* @return \Illuminate\Routing\Route |
| 105 |
|
*/ |
| 106 |
|
protected function addRelationshipUpdate($name, $base, array $relationships, $controller, array $options) |
| 107 |
|
{ |
| 108 |
|
$uri = $this->getRelationshipUri($name, $base); |
| 109 |
|
$action = $this->getResourceAction($name, $controller, 'updateRelationship', $options); |
| 110 |
|
|
| 111 |
|
return $this->router->match(['PUT', 'PATCH'], $uri, $action) |
| 112 |
|
->where('relationship', '(' . implode(')|(', $relationships) . ')'); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
/** |
| 116 |
|
* Get the URI for resource relationships. |