Skip to content

Commit

Permalink
merge patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rohleder committed Feb 22, 2016
2 parents dd68348 + 404b90d commit 300e850
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,20 @@ public function translate(array $translations)

public function member($route)
{
$resource = new Resource;
$resource = new self;
$resource->set($route);
$this->nest($resource);
}

/**
* Nested routes capture the relation between a resource and another resource.
*
* @param Resource $resource
* @param self $resource
* @return self
*/

public function nest(Resource $resource)
public function nest(self $resource)
{
/** @var self $resource */
foreach ($this->routes as $route) {
if ($route->getAction()[1] === "show") {
$this->set($resource->forget()->setPrefix($this->getNestedPrefix($route->getPattern()))); break;
Expand All @@ -134,14 +133,13 @@ public function nest(Resource $resource)
* Nest resources but with only build routes with the minimal amount of information
* to uniquely identify the resource.
*
* @param Resource $resource
* @param self $resource
* @return self
*/

public function shallow(Resource $resource)
public function shallow(self $resource)
{
/** @var self $resource */
$newResource = new Resource;
$newResource = new self;
$resource->forget();
$routes = $resource->all();

Expand Down

0 comments on commit 300e850

Please sign in to comment.