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

[5.4] Add apiResource function to Router #19347

Merged
merged 3 commits into from May 27, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+15 −0
Diff settings

Always

Just for now

Next

Add apiResource function to Router

  • Loading branch information...
ZapsterStudios committed May 25, 2017
commit 1966ea52ce7627e56a4a48215b38b3009ba9d2a6
@@ -252,6 +252,21 @@ public function resource($name, $controller, array $options = [])
$registrar->register($name, $controller, $options);
}
/**
* Route an api resource to a controller.
*
* @param string $name
* @param string $controller
* @param array $options
* @return void
*/
public function apiResource($name, $controller, array $options = [])
{
$this->resource($name, $controller, array_merge([
'only' => ['index', 'show', 'store', 'update', 'destroy']
], $options));
}
/**
* Create a route group with shared attributes.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.