summaryrefslogtreecommitdiff
path: root/src/products/routes/web.php
blob: 023939fbbaf6648cda6b3a2ea4effd8896272f2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| 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->get('/', function () use ($router) {
	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']);
});