Created
July 28, 2015 18:18
-
-
Save ahmadazimi/b57f8594a6e44f0a4705 to your computer and use it in GitHub Desktop.
Call controller from route closure
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
<?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