Last active
December 17, 2015 17:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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