Skip to content

Instantly share code, notes, and snippets.

@sahanh
Created May 21, 2013 23:27
Show Gist options
  • Save sahanh/5624102 to your computer and use it in GitHub Desktop.
Save sahanh/5624102 to your computer and use it in GitHub Desktop.
Getting controller and action before laravel populate them
$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