c3lf-system-3/routes/web.php
Jan Felix Wiebe 194a0a81e0 added items
2019-11-15 22:26:54 +01:00

43 lines
No EOL
1.8 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->get('/', function () use ($router) {
return $router->app->version();
});
$router->group(['prefix' => 'api'], function () use ($router) {
// events
$router->get('events', ['uses' => 'EventController@showAllEvents']);
$router->get('events/{id}', ['uses' => 'EventController@showOneEvent']);
$router->post('events', ['uses' => 'EventController@create']);
$router->delete('events/{id}', ['uses' => 'EventController@delete']);
$router->put('events/{id}', ['uses' => 'EventController@update']);
});
$router->group(['prefix' => 'api'], function () use ($router) {
// containers
$router->get('containers', ['uses' => 'ContainerController@showAllContainers']);
$router->get('containers/{id}', ['uses' => 'ContainerController@showOneContainer']);
$router->post('containers', ['uses' => 'ContainerController@create']);
$router->delete('containers/{id}', ['uses' => 'ContainerController@delete']);
$router->put('containers/{id}', ['uses' => 'ContainerController@update']);
});
$router->group(['prefix' => 'api'], function () use ($router) {
// items
$router->get('items', ['uses' => 'ItemController@showAllItems']);
$router->get('items/{id}', ['uses' => 'ItemController@showOneItem']);
$router->post('items', ['uses' => 'ItemController@create']);
$router->delete('items/{id}', ['uses' => 'ItemController@delete']);
$router->put('items/{id}', ['uses' => 'ItemController@update']);
});