I am new to Lumen and just tried to create an app. I am getting an error that states at Application->Laravel\Lumen\Concerns{closure}(8, 'Undefined variable: app', '/Users/test/Sites/books/routes/web.php', 14, array('router' => object(Router))) when I try to use this bit of code:
$app->group(['prefix' => 'book/'], function() use ($app) {
$app->get('/','BooksController@index'); //get all the routes
$app->post('/','BooksController@store'); //store single route
$app->get('/{id}/', 'BooksController@show'); //get single route
$app->put('/{id}/','BooksController@update'); //update single route
$app->delete('/{id}/','BooksController@destroy'); //delete single route
});
According to the documents https://lumen.laravel.com/docs/5.5/routing this should work. I am following a tutorial found at https://paulund.co.uk/creating-a-rest-api-with-lumen I know that 5.5 just came out a few days ago, so there might not be anyone that knows the answer yet, but any help would be appreciated.