Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahmadazimi/b57f8594a6e44f0a4705 to your computer and use it in GitHub Desktop.
Save ahmadazimi/b57f8594a6e44f0a4705 to your computer and use it in GitHub Desktop.
Call controller from route closure
<?php
// 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