summaryrefslogtreecommitdiff
path: root/src/products/routes/web.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/products/routes/web.php')
-rw-r--r--src/products/routes/web.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/products/routes/web.php b/src/products/routes/web.php
index 5c84bf2..023939f 100644
--- a/src/products/routes/web.php
+++ b/src/products/routes/web.php
@@ -11,8 +11,14 @@
| 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->get('/', function () use ($router) {
- return $router->app->version();
+ return $router->app->version();
+});
+
+$router->group(['prefix' => 'api/v1', 'middleware' => 'auth'], function () use ($router) {
+ $router->get('products', ['middleware' => 'auth:products:read', 'uses' => 'ProductsController@get_all']);
+ $router->post('products', ['middleware' => 'auth:products:create', 'uses' => 'ProductsController@create']);
+ $router->delete('products/{id}', ['middleware' => 'auth:products:delete', 'uses' => 'ProductsController@delete']);
});