Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Add apiResource in RouteRegistrar #31857

Merged
merged 2 commits into from
Mar 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add apiResource in RouteRegistrar
  • Loading branch information
LasseRafn authored Mar 9, 2020
commit c129177a0760834c5c2c5bf0c6154504562aa35b
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