group(['prefix' => 'api', 'middleware' => ['client.credentials']], function () use ($router) { $router->group(['prefix' => 'product'], function () use ($router) { $router->get('/', ['uses' => 'ProductController@index']); $router->post('/', ['uses' => 'ProductController@store']); $router->get('/{product}', ['uses' => 'ProductController@show']); $router->patch('/{product}', ['uses' => 'ProductController@update']); $router->delete('/{product}', ['uses' => 'ProductController@destroy']); }); $router->group(['prefix' => 'order'], function () use ($router) { $router->get('/', ['uses' => 'OrderController@index']); $router->post('/', ['uses' => 'OrderController@store']); $router->get('/{order}', ['uses' => 'OrderController@show']); $router->patch('/{order}', ['uses' => 'OrderController@update']); $router->delete('/{order}', ['uses' => 'OrderController@destroy']); }); });