Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Last active December 17, 2015 17:39
Show Gist options
  • Save clouddueling/5647522 to your computer and use it in GitHub Desktop.
Save clouddueling/5647522 to your computer and use it in GitHub Desktop.
Enable API like get requests on single objects user/1 /laravel/routing/controller.php public static function call around line 132
// For convenience we will set the current controller and action on the
// Request's route instance so they can be easily accessed from the
// application. This is sometimes useful for dynamic situations.
if ( ! is_null($route = Request::route())) {
$route->controller = $name;
if (is_numeric($method)) {
$parameters = array(
'id' => $method,
);
$method = "index";
$route->controller_action = "index";
} else {
$route->controller_action = $method;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment