mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
extracts the dashboard routes
This commit is contained in:
parent
dbb87782e3
commit
b3b3de3a90
@ -68,8 +68,14 @@ class RouteServiceProvider extends ServiceProvider
|
||||
public function map(Router $router)
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function (Router $router) {
|
||||
foreach (glob(app_path('Http//Routes').'/*.php') as $file) {
|
||||
$this->app->make('CachetHQ\\Cachet\\Http\\Routes\\'.basename($file, '.php'))->map($router);
|
||||
$path = app_path('Http/Routes');
|
||||
|
||||
foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) {
|
||||
$class = substr($file, strlen($path));
|
||||
$class = str_replace('/', '\\', $class);
|
||||
$class = substr($class, 0, -4);
|
||||
|
||||
$this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}")->map($router);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
45
app/Http/Routes/Dashboard/ApiRoutes.php
Normal file
45
app/Http/Routes/Dashboard/ApiRoutes.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard api routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class ApiRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard api routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.api.',
|
||||
'prefix' => 'dashboard/api',
|
||||
], function (Registrar $router) {
|
||||
$router->get('incidents/templates', 'ApiController@getIncidentTemplate');
|
||||
$router->post('components/groups/order', 'ApiController@postUpdateComponentGroupOrder');
|
||||
$router->post('components/order', 'ApiController@postUpdateComponentOrder');
|
||||
$router->post('components/{component}', 'ApiController@postUpdateComponent');
|
||||
});
|
||||
}
|
||||
}
|
44
app/Http/Routes/Dashboard/BaseRoutes.php
Normal file
44
app/Http/Routes/Dashboard/BaseRoutes.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard base routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class BaseRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard base routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'auth'], 'namespace' => 'Dashboard'], function (Registrar $router) {
|
||||
$router->get('admin', 'DashboardController@redirectAdmin');
|
||||
|
||||
$router->group(['prefix' => 'dashboard', 'as' => 'dashboard.'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'DashboardController@showDashboard',
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
71
app/Http/Routes/Dashboard/ComponentRoutes.php
Normal file
71
app/Http/Routes/Dashboard/ComponentRoutes.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard component routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class ComponentRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard component routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.components.',
|
||||
'prefix' => 'dashboard/components',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'ComponentController@showComponents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'ComponentController@showAddComponent',
|
||||
]);
|
||||
$router->post('add', 'ComponentController@createComponentAction');
|
||||
$router->get('groups', [
|
||||
'as' => 'groups',
|
||||
'uses' => 'ComponentController@showComponentGroups',
|
||||
]);
|
||||
$router->get('groups/add', [
|
||||
'as' => 'groups.add',
|
||||
'uses' => 'ComponentController@showAddComponentGroup',
|
||||
]);
|
||||
$router->get('groups/edit/{component_group}', [
|
||||
'as' => 'groups.edit',
|
||||
'uses' => 'ComponentController@showEditComponentGroup',
|
||||
]);
|
||||
$router->post('groups/edit/{component_group}', 'ComponentController@updateComponentGroupAction');
|
||||
$router->delete('groups/{component_group}/delete', 'ComponentController@deleteComponentGroupAction');
|
||||
$router->post('groups/add', 'ComponentController@postAddComponentGroup');
|
||||
$router->get('{component}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'ComponentController@showEditComponent',
|
||||
]);
|
||||
$router->delete('{component}/delete', 'ComponentController@deleteComponentAction');
|
||||
$router->post('{component}/edit', 'ComponentController@updateComponentAction');
|
||||
});
|
||||
}
|
||||
}
|
59
app/Http/Routes/Dashboard/IncidentRoutes.php
Normal file
59
app/Http/Routes/Dashboard/IncidentRoutes.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard incident routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class IncidentRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard incident routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.incidents.',
|
||||
'prefix' => 'dashboard/incidents',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'IncidentController@showIncidents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'IncidentController@showAddIncident',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
'uses' => 'IncidentController@deleteIncidentAction',
|
||||
]);
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'IncidentController@showEditIncidentAction',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'IncidentController@editIncidentAction');
|
||||
});
|
||||
}
|
||||
}
|
56
app/Http/Routes/Dashboard/MetricRoutes.php
Normal file
56
app/Http/Routes/Dashboard/MetricRoutes.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard metric routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class MetricRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard metric routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.metrics.',
|
||||
'prefix' => 'dashboard/metrics',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'MetricController@showMetrics',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'MetricController@showAddMetric',
|
||||
]);
|
||||
$router->post('add', 'MetricController@createMetricAction');
|
||||
$router->delete('{metric}/delete', 'MetricController@deleteMetricAction');
|
||||
$router->get('{metric}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'MetricController@showEditMetricAction',
|
||||
]);
|
||||
$router->post('{metric}/edit', 'MetricController@editMetricAction');
|
||||
});
|
||||
}
|
||||
}
|
59
app/Http/Routes/Dashboard/ScheduleRoutes.php
Normal file
59
app/Http/Routes/Dashboard/ScheduleRoutes.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard schedule routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class ScheduleRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard schedule routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.schedule.',
|
||||
'prefix' => 'dashboard/schedule',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'ScheduleController@showIndex',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'ScheduleController@showAddSchedule',
|
||||
]);
|
||||
$router->post('add', 'ScheduleController@addScheduleAction');
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'ScheduleController@showEditSchedule',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'ScheduleController@editScheduleAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
'uses' => 'ScheduleController@deleteScheduleAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
74
app/Http/Routes/Dashboard/SettingRoutes.php
Normal file
74
app/Http/Routes/Dashboard/SettingRoutes.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard setting routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class SettingRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard setting routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.settings.',
|
||||
'prefix' => 'dashboard/settings',
|
||||
], function (Registrar $router) {
|
||||
$router->get('setup', [
|
||||
'as' => 'setup',
|
||||
'uses' => 'SettingsController@showSetupView',
|
||||
]);
|
||||
$router->get('analytics', [
|
||||
'as' => 'analytics',
|
||||
'uses' => 'SettingsController@showAnalyticsView',
|
||||
]);
|
||||
$router->get('localization', [
|
||||
'as' => 'localization',
|
||||
'uses' => 'SettingsController@showLocalizationView',
|
||||
]);
|
||||
$router->get('security', [
|
||||
'as' => 'security',
|
||||
'uses' => 'SettingsController@showSecurityView',
|
||||
]);
|
||||
$router->get('theme', [
|
||||
'as' => 'theme',
|
||||
'uses' => 'SettingsController@showThemeView',
|
||||
]);
|
||||
$router->get('stylesheet', [
|
||||
'as' => 'stylesheet',
|
||||
'uses' => 'SettingsController@showStylesheetView',
|
||||
]);
|
||||
$router->get('customization', [
|
||||
'as' => 'customization',
|
||||
'uses' => 'SettingsController@showCustomizationView',
|
||||
]);
|
||||
$router->get('credits', [
|
||||
'as' => 'credits',
|
||||
'uses' => 'SettingsController@showCreditsView',
|
||||
]);
|
||||
$router->post('/', 'SettingsController@postSettings');
|
||||
});
|
||||
}
|
||||
}
|
51
app/Http/Routes/Dashboard/SubscriberRoutes.php
Normal file
51
app/Http/Routes/Dashboard/SubscriberRoutes.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard subscriber routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class SubscriberRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard subscriber routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.subscribers.',
|
||||
'prefix' => 'dashboard/subscribers',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'SubscriberController@showSubscribers',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'SubscriberController@showAddSubscriber',
|
||||
]);
|
||||
$router->post('add', 'SubscriberController@createSubscriberAction');
|
||||
$router->delete('{subscriber}/delete', 'SubscriberController@deleteSubscriberAction');
|
||||
});
|
||||
}
|
||||
}
|
61
app/Http/Routes/Dashboard/TeamRoutes.php
Normal file
61
app/Http/Routes/Dashboard/TeamRoutes.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard team routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class TeamRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard team routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.team.',
|
||||
'prefix' => 'dashboard/team',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'TeamController@showTeamView',
|
||||
]);
|
||||
|
||||
$router->group(['middleware' => 'admin'], function (Registrar $router) {
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'TeamController@showAddTeamMemberView',
|
||||
]);
|
||||
$router->get('invite', [
|
||||
'as' => 'invite',
|
||||
'uses' => 'TeamController@showInviteTeamMemberView',
|
||||
]);
|
||||
$router->get('{user}', ['as' => 'edit', 'uses' => 'TeamController@showTeamMemberView']);
|
||||
$router->post('add', 'TeamController@postAddUser');
|
||||
$router->post('invite', 'TeamController@postInviteUser');
|
||||
$router->post('{user}', 'TeamController@postUpdateUser');
|
||||
$router->delete('{user}/delete', 'TeamController@deleteUser');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
56
app/Http/Routes/Dashboard/TemplateRoutes.php
Normal file
56
app/Http/Routes/Dashboard/TemplateRoutes.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard template routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class TemplateRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard template routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.templates.',
|
||||
'prefix' => 'dashboard/templates',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'IncidentController@showTemplates',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'IncidentController@showAddIncidentTemplate',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentTemplateAction');
|
||||
$router->get('{incident_template}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'IncidentController@showEditTemplateAction',
|
||||
]);
|
||||
$router->post('{incident_template}/edit', 'IncidentController@editTemplateAction');
|
||||
$router->delete('{incident_template}/delete', 'IncidentController@deleteTemplateAction');
|
||||
});
|
||||
}
|
||||
}
|
47
app/Http/Routes/Dashboard/UserRoutes.php
Normal file
47
app/Http/Routes/Dashboard/UserRoutes.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes\Dashboard;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard user routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Connor S. Parks <connor@connorvg.tv>
|
||||
*/
|
||||
class UserRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard user routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.user.',
|
||||
'prefix' => 'dashboard/user',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'user',
|
||||
'uses' => 'UserController@showUser',
|
||||
]);
|
||||
$router->post('/', 'UserController@postUser');
|
||||
$router->get('{user}/api/regen', 'UserController@regenerateApiKey');
|
||||
});
|
||||
}
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Routes;
|
||||
|
||||
use Illuminate\Contracts\Routing\Registrar;
|
||||
|
||||
/**
|
||||
* This is the dashboard routes class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class DashboardRoutes
|
||||
{
|
||||
/**
|
||||
* Define the dashboard routes.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Routing\Registrar $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'auth'], 'namespace' => 'Dashboard'], function (Registrar $router) {
|
||||
$router->get('admin', 'DashboardController@redirectAdmin');
|
||||
|
||||
$router->group(['prefix' => 'dashboard', 'as' => 'dashboard.'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'DashboardController@showDashboard',
|
||||
]);
|
||||
|
||||
$router->group(['as' => 'components.', 'prefix' => 'components'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'ComponentController@showComponents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'ComponentController@showAddComponent',
|
||||
]);
|
||||
$router->post('add', 'ComponentController@createComponentAction');
|
||||
$router->get('groups', [
|
||||
'as' => 'groups',
|
||||
'uses' => 'ComponentController@showComponentGroups',
|
||||
]);
|
||||
$router->get('groups/add', [
|
||||
'as' => 'groups.add',
|
||||
'uses' => 'ComponentController@showAddComponentGroup',
|
||||
]);
|
||||
$router->get('groups/edit/{component_group}', [
|
||||
'as' => 'groups.edit',
|
||||
'uses' => 'ComponentController@showEditComponentGroup',
|
||||
]);
|
||||
$router->post('groups/edit/{component_group}', 'ComponentController@updateComponentGroupAction');
|
||||
$router->delete('groups/{component_group}/delete', 'ComponentController@deleteComponentGroupAction');
|
||||
$router->post('groups/add', 'ComponentController@postAddComponentGroup');
|
||||
$router->get('{component}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'ComponentController@showEditComponent',
|
||||
]);
|
||||
$router->delete('{component}/delete', 'ComponentController@deleteComponentAction');
|
||||
$router->post('{component}/edit', 'ComponentController@updateComponentAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'incidents.', 'prefix' => 'incidents'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'IncidentController@showIncidents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'IncidentController@showAddIncident',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
'uses' => 'IncidentController@deleteIncidentAction',
|
||||
]);
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'IncidentController@showEditIncidentAction',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'IncidentController@editIncidentAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'schedule.', 'prefix' => 'schedule'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'ScheduleController@showIndex',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'ScheduleController@showAddSchedule',
|
||||
]);
|
||||
$router->post('add', 'ScheduleController@addScheduleAction');
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'ScheduleController@showEditSchedule',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'ScheduleController@editScheduleAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
'uses' => 'ScheduleController@deleteScheduleAction',
|
||||
]);
|
||||
});
|
||||
|
||||
$router->group(['as' => 'templates.', 'prefix' => 'templates'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'IncidentController@showTemplates',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'IncidentController@showAddIncidentTemplate',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentTemplateAction');
|
||||
$router->get('{incident_template}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'IncidentController@showEditTemplateAction',
|
||||
]);
|
||||
$router->post('{incident_template}/edit', 'IncidentController@editTemplateAction');
|
||||
$router->delete('{incident_template}/delete', 'IncidentController@deleteTemplateAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'subscribers.', 'prefix' => 'subscribers'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'SubscriberController@showSubscribers',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'SubscriberController@showAddSubscriber',
|
||||
]);
|
||||
$router->post('add', 'SubscriberController@createSubscriberAction');
|
||||
$router->delete('{subscriber}/delete', 'SubscriberController@deleteSubscriberAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'metrics.', 'prefix' => 'metrics'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'MetricController@showMetrics',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'MetricController@showAddMetric',
|
||||
]);
|
||||
$router->post('add', 'MetricController@createMetricAction');
|
||||
$router->delete('{metric}/delete', 'MetricController@deleteMetricAction');
|
||||
$router->get('{metric}/edit', [
|
||||
'as' => 'edit',
|
||||
'uses' => 'MetricController@showEditMetricAction',
|
||||
]);
|
||||
$router->post('{metric}/edit', 'MetricController@editMetricAction');
|
||||
});
|
||||
|
||||
$router->group(['as' => 'team.', 'prefix' => 'team'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'uses' => 'TeamController@showTeamView',
|
||||
]);
|
||||
|
||||
$router->group(['middleware' => 'admin'], function (Registrar $router) {
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
'uses' => 'TeamController@showAddTeamMemberView',
|
||||
]);
|
||||
$router->get('invite', [
|
||||
'as' => 'invite',
|
||||
'uses' => 'TeamController@showInviteTeamMemberView',
|
||||
]);
|
||||
$router->get('{user}', ['as' => 'edit', 'uses' => 'TeamController@showTeamMemberView']);
|
||||
$router->post('add', 'TeamController@postAddUser');
|
||||
$router->post('invite', 'TeamController@postInviteUser');
|
||||
$router->post('{user}', 'TeamController@postUpdateUser');
|
||||
$router->delete('{user}/delete', 'TeamController@deleteUser');
|
||||
});
|
||||
});
|
||||
|
||||
$router->group(['as' => 'settings.', 'prefix' => 'settings'], function (Registrar $router) {
|
||||
$router->get('setup', [
|
||||
'as' => 'setup',
|
||||
'uses' => 'SettingsController@showSetupView',
|
||||
]);
|
||||
$router->get('analytics', [
|
||||
'as' => 'analytics',
|
||||
'uses' => 'SettingsController@showAnalyticsView',
|
||||
]);
|
||||
$router->get('localization', [
|
||||
'as' => 'localization',
|
||||
'uses' => 'SettingsController@showLocalizationView',
|
||||
]);
|
||||
$router->get('security', [
|
||||
'as' => 'security',
|
||||
'uses' => 'SettingsController@showSecurityView',
|
||||
]);
|
||||
$router->get('theme', [
|
||||
'as' => 'theme',
|
||||
'uses' => 'SettingsController@showThemeView',
|
||||
]);
|
||||
$router->get('stylesheet', [
|
||||
'as' => 'stylesheet',
|
||||
'uses' => 'SettingsController@showStylesheetView',
|
||||
]);
|
||||
$router->get('customization', [
|
||||
'as' => 'customization',
|
||||
'uses' => 'SettingsController@showCustomizationView',
|
||||
]);
|
||||
$router->get('credits', [
|
||||
'as' => 'credits',
|
||||
'uses' => 'SettingsController@showCreditsView',
|
||||
]);
|
||||
$router->post('/', 'SettingsController@postSettings');
|
||||
});
|
||||
|
||||
$router->group(['prefix' => 'user'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'user',
|
||||
'uses' => 'UserController@showUser',
|
||||
]);
|
||||
$router->post('/', 'UserController@postUser');
|
||||
$router->get('{user}/api/regen', 'UserController@regenerateApiKey');
|
||||
});
|
||||
|
||||
$router->group(['prefix' => 'api'], function (Registrar $router) {
|
||||
$router->get('incidents/templates', 'ApiController@getIncidentTemplate');
|
||||
$router->post('components/groups/order', 'ApiController@postUpdateComponentGroupOrder');
|
||||
$router->post('components/order', 'ApiController@postUpdateComponentOrder');
|
||||
$router->post('components/{component}', 'ApiController@postUpdateComponent');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user