Simple package to handle routes
$ composer require lcloss/route
Create routes like these:
Route::get('/', 'MainController@index');
Route::get('/view', 'ViewController@index');
Route::get(['set' => '/edit', 'as' => 'edit'], 'ViewController@edit');
Route::get(['set' => '/show/{id}', 'as' => 'show'], 'ViewController@show');
Route::get('/test/one/two/tree', function() {
echo '<a href="' . Route::translate('show', ['id' => 1]) . '">Show record 1</a>';
});
You can create an helper easly. An exemple is located at helpers
folder.
This work was inspired by the fantastic article Construir um sistema de rotas para MVC, de Alexandre Barbosa