Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aquasmit/1cbb55b59ad9620d23157f13acd10c25 to your computer and use it in GitHub Desktop.
Save aquasmit/1cbb55b59ad9620d23157f13acd10c25 to your computer and use it in GitHub Desktop.
Laravel - Call controller from route closure

Laravel - Call controller from route closure

Route::get('/example', function()
{
  // Run controller and method
  $app = app();
  $controller = $app->make('ExampleController');
  return $controller->callAction('index', $parameters = array());

});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment