this is small utility for creating laravel style routing and controller, not exactly similar but it is. it also have middleware support and symfony like service container. for intializing routing we have to initialize App
<?php
$app = new App();
$router = $app->get("Router");
$router->get('/home',function()
{
echo "From Home Route";
});
we can get any class with automatic dependency resolve using get function of app class
<?php
$router->get('/app','AppController@index');
<?php
$router->group('/app',function($router)
{
$router->get('/about','AboutController@index');
});
<?php
$router->group('/app',function($router)
{
$router->get('/about','AboutController@index');
},['auth']);
middleware class should be declare inside Config/app.php $middleware array
$router->get('/:user',function(Request $request,Response $response,$user)
{
echo "From Home Route";
});