Call controller from route closure

Submitted by GesJeremie - 2 years ago

See the title ...

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

});
comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks