Skip to content

Commit

Permalink
[7.x] Add apiResource in RouteRegistrar (#31857)
Browse files Browse the repository at this point in the history
* Add apiResource in RouteRegistrar

* Fix indentation for StyleCI
  • Loading branch information
LasseRafn authored Mar 9, 2020
1 parent 89eb89b commit a2ca152
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Illuminate/Routing/RouteRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ public function resource($name, $controller, array $options = [])
return $this->router->resource($name, $controller, $this->attributes + $options);
}

/**
* Route an API resource to a controller.
*
* @param string $name
* @param string $controller
* @param array $options
* @return \Illuminate\Routing\PendingResourceRegistration
*/
public function apiResource($name, $controller, array $options = [])
{
return $this->router->apiResource($name, $controller, $this->attributes + $options);
}

/**
* Create a route group with shared attributes.
*
Expand Down

0 comments on commit a2ca152

Please sign in to comment.