Created
May 21, 2013 23:27
-
-
Save sahanh/5624102 to your computer and use it in GitHub Desktop.
Getting controller and action before laravel populate them
This file contains 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
$route = Router::route(Request::method(), URI::current()); | |
$delegate = array_get($route->action, 'uses'); | |
$reflector = new ReflectionClass('Controller'); | |
$method = $reflector->getMethod('references'); | |
$method->setAccessible(true); | |
$d = $delegate; | |
$p = $route->parameters; | |
$method->invokeArgs(null, [&$d, &$p]); | |
dd($d); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment