c3lf-system-3/routes/web.php

41 lines
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' => '1'], function () use ($router) {
// events
$router->get('events', ['uses' => 'EventController@showAllEvents']);
$router->get('event/{id}', ['uses' => 'EventController@showOneEvent']);
$router->post('event', ['uses' => 'EventController@create']);
$router->delete('event/{id}', ['uses' => 'EventController@delete']);
$router->put('event/{id}', ['uses' => 'EventController@update']);
// containers
$router->get('boxes', ['uses' => 'ContainerController@showAllContainers']);
$router->get('box/{id}', ['uses' => 'ContainerController@showOneContainer']);
$router->post('box', ['uses' => 'ContainerController@create']);
$router->delete('box/{id}', ['uses' => 'ContainerController@delete']);
$router->put('box/{id}', ['uses' => 'ContainerController@update']);
// items
$router->get('{event}/items', ['uses' => 'ItemController@showAllItems']);
$router->get('{event}/items/{query}', ['uses' => 'ItemController@searchAllItems']);
$router->get('{event}/item/{id}', ['uses' => 'ItemController@showOneItem']);
$router->post('{event}/item', ['uses' => 'ItemController@create']);
$router->delete('{event}/item/{id}', ['uses' => 'ItemController@delete']);
$router->put('{event}/item/{id}', ['uses' => 'ItemController@update']);
});