Validating routes in Lumen

3

In Laravel I have for example:

Route::get( '/produtos/mostra/{id}', 
    'ProdutoController@mostra' 
)->where('id', '[0-9]+');

How would this type of validation be done in Lumen ? Since a route is caused by $app :

$app->get('insert', function () {

});
    
asked by anonymous 30.12.2016 / 16:23

1 answer

2

Do so in accordance with Documentation .

$app->get('/produtos/mostra/{id:[0-9]+}', 'ProdutoController@mostra');
    
30.12.2016 / 17:51