engelsystem/config/routes.php

108 lines
3.7 KiB
PHP
Raw Normal View History

<?php
use FastRoute\RouteCollector;
/** @var RouteCollector $route */
// Pages
2019-06-13 15:18:47 +02:00
$route->get('/', 'HomeController@index');
2018-09-02 02:13:18 +02:00
$route->get('/credits', 'CreditsController@index');
$route->get('/health', 'HealthController@index');
2018-10-25 18:53:05 +02:00
// Authentication
$route->get('/login', 'AuthController@login');
$route->post('/login', 'AuthController@postLogin');
2018-10-25 18:53:05 +02:00
$route->get('/logout', 'AuthController@logout');
2020-11-15 18:47:30 +01:00
// OAuth
$route->get('/oauth/{provider:\w+}', 'OAuthController@index');
$route->post('/oauth/{provider:\w+}/connect', 'OAuthController@connect');
$route->post('/oauth/{provider:\w+}/disconnect', 'OAuthController@disconnect');
// User settings
2020-11-23 20:41:02 +01:00
$route->get('/settings/password', 'SettingsController@password');
$route->post('/settings/password', 'SettingsController@savePassword');
2020-11-15 18:47:30 +01:00
$route->get('/settings/oauth', 'SettingsController@oauth');
2019-10-08 16:17:06 +02:00
// Password recovery
$route->get('/password/reset', 'PasswordResetController@reset');
$route->post('/password/reset', 'PasswordResetController@postReset');
$route->get('/password/reset/{token:.+}', 'PasswordResetController@resetPassword');
$route->post('/password/reset/{token:.+}', 'PasswordResetController@postResetPassword');
// Stats
$route->get('/metrics', 'Metrics\\Controller@metrics');
$route->get('/stats', 'Metrics\\Controller@stats');
2020-04-05 16:54:45 +02:00
// News
$route->get('/news', 'NewsController@index');
$route->get('/meetings', 'NewsController@meetings');
$route->get('/news/{id:\d+}', 'NewsController@show');
$route->post('/news/{id:\d+}', 'NewsController@comment');
2020-12-06 00:16:15 +01:00
// FAQ
$route->get('/faq', 'FaqController@index');
2020-12-18 18:27:10 +01:00
// Questions
$route->get('/questions', 'QuestionsController@index');
$route->post('/questions', 'QuestionsController@delete');
$route->get('/questions/new', 'QuestionsController@add');
$route->post('/questions/new', 'QuestionsController@save');
// API
$route->get('/api[/{resource:.+}]', 'ApiController@index');
// Design
$route->get('/design', 'DesignController@index');
// Administration
$route->addGroup(
'/admin',
function (RouteCollector $route) {
2020-12-06 00:16:15 +01:00
// FAQ
$route->addGroup(
'/faq',
function (RouteCollector $route) {
$route->get('[/{id:\d+}]', 'Admin\\FaqController@edit');
$route->post('[/{id:\d+}]', 'Admin\\FaqController@save');
}
);
2020-05-01 16:29:28 +02:00
// Log
$route->get('/logs', 'Admin\\LogsController@index');
$route->post('/logs', 'Admin\\LogsController@index');
// Schedule
$route->addGroup(
'/schedule',
function (RouteCollector $route) {
$route->get('', 'Admin\\Schedule\\ImportSchedule@index');
2020-11-21 20:54:04 +01:00
$route->get('/edit[/{id:\d+}]', 'Admin\\Schedule\\ImportSchedule@edit');
$route->post('/edit[/{id:\d+}]', 'Admin\\Schedule\\ImportSchedule@save');
$route->get('/load/{id:\d+}', 'Admin\\Schedule\\ImportSchedule@loadSchedule');
$route->post('/import/{id:\d+}', 'Admin\\Schedule\\ImportSchedule@importSchedule');
}
);
2020-05-01 16:29:28 +02:00
2020-12-18 18:27:10 +01:00
// Questions
$route->addGroup(
'/questions',
function (RouteCollector $route) {
$route->get('', 'Admin\\QuestionsController@index');
$route->post('', 'Admin\\QuestionsController@delete');
$route->get('/{id:\d+}', 'Admin\\QuestionsController@edit');
$route->post('/{id:\d+}', 'Admin\\QuestionsController@save');
}
);
2020-05-01 16:29:28 +02:00
// News
2020-04-05 16:54:45 +02:00
$route->addGroup(
'/news',
function (RouteCollector $route) {
$route->get('[/{id:\d+}]', 'Admin\\NewsController@edit');
$route->post('[/{id:\d+}]', 'Admin\\NewsController@save');
}
);
}
);