Files
microservice-api-gateway/routes/web.php
T
Behzad Babaei 91f96ceecd initial commit
2020-03-28 17:07:00 +04:30

32 lines
1.3 KiB
PHP

<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->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']);
});
});