Completely refactor all routes
This commit is contained in:
@@ -58,17 +58,17 @@ class AuthController extends Controller
|
||||
if (Auth::user()->hasTwoFactor) {
|
||||
Session::put('2fa_id', Auth::user()->id);
|
||||
|
||||
return Redirect::route('auth.two-factor');
|
||||
return cachet_route('auth.two-factor');
|
||||
}
|
||||
|
||||
Auth::attempt($loginData, $rememberUser);
|
||||
|
||||
event(new UserLoggedInEvent(Auth::user()));
|
||||
|
||||
return Redirect::intended('dashboard');
|
||||
return Redirect::intended(cachet_route('dashboard'));
|
||||
}
|
||||
|
||||
return Redirect::route('auth.login')
|
||||
return cachet_route('auth.login')
|
||||
->withInput(Binput::except('password'))
|
||||
->withError(trans('forms.login.invalid'));
|
||||
}
|
||||
@@ -113,11 +113,11 @@ class AuthController extends Controller
|
||||
// Failed login, log back out.
|
||||
Auth::logout();
|
||||
|
||||
return Redirect::route('auth.login')->withError(trans('forms.login.invalid-token'));
|
||||
return cachet_route('auth.login')->withError(trans('forms.login.invalid-token'));
|
||||
}
|
||||
}
|
||||
|
||||
return Redirect::route('auth.login')->withError(trans('forms.login.invalid-token'));
|
||||
return cachet_route('auth.login')->withError(trans('forms.login.invalid-token'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Tag;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class ComponentController extends Controller
|
||||
@@ -45,13 +44,13 @@ class ComponentController extends Controller
|
||||
$this->subMenu = [
|
||||
'components' => [
|
||||
'title' => trans('dashboard.components.components'),
|
||||
'url' => route('dashboard.components.index'),
|
||||
'url' => cachet_route('dashboard.components'),
|
||||
'icon' => 'ion-ios-browsers',
|
||||
'active' => false,
|
||||
],
|
||||
'groups' => [
|
||||
'title' => trans_choice('dashboard.components.groups.groups', 2),
|
||||
'url' => route('dashboard.components.groups'),
|
||||
'url' => cachet_route('dashboard.components.groups'),
|
||||
'icon' => 'ion-folder',
|
||||
'active' => false,
|
||||
],
|
||||
@@ -138,7 +137,7 @@ class ComponentController extends Controller
|
||||
$componentData['enabled']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.edit', ['id' => $component->id])
|
||||
return cachet_route('dashboard.components.edit', [$component->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
@@ -154,7 +153,7 @@ class ComponentController extends Controller
|
||||
|
||||
$component->tags()->sync($componentTags);
|
||||
|
||||
return Redirect::route('dashboard.components.edit', ['id' => $component->id])
|
||||
return cachet_route('dashboard.components.edit', [$component->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.edit.success')));
|
||||
}
|
||||
|
||||
@@ -191,7 +190,7 @@ class ComponentController extends Controller
|
||||
$componentData['enabled']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.add')
|
||||
return cachet_route('dashboard.components.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
@@ -207,7 +206,7 @@ class ComponentController extends Controller
|
||||
|
||||
$component->tags()->sync($componentTags);
|
||||
|
||||
return Redirect::route('dashboard.components.index')
|
||||
return cachet_route('dashboard.components')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.add.success')));
|
||||
}
|
||||
|
||||
@@ -222,7 +221,7 @@ class ComponentController extends Controller
|
||||
{
|
||||
dispatch(new RemoveComponentCommand($component));
|
||||
|
||||
return Redirect::route('dashboard.components.index')
|
||||
return cachet_route('dashboard.components')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success')));
|
||||
}
|
||||
|
||||
@@ -237,7 +236,7 @@ class ComponentController extends Controller
|
||||
{
|
||||
dispatch(new RemoveComponentGroupCommand($group));
|
||||
|
||||
return Redirect::route('dashboard.components.groups')
|
||||
return cachet_route('dashboard.components.groups')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success')));
|
||||
}
|
||||
|
||||
@@ -281,13 +280,13 @@ class ComponentController extends Controller
|
||||
Binput::get('visible')
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.groups.add')
|
||||
return cachet_route('dashboard.components.groups.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.components.groups')
|
||||
return cachet_route('dashboard.components.groups')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.add.success')));
|
||||
}
|
||||
|
||||
@@ -309,13 +308,13 @@ class ComponentController extends Controller
|
||||
Binput::get('visible')
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.components.groups.edit', ['id' => $group->id])
|
||||
return cachet_route('dashboard.components.groups.edit', [$group->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.components.groups.edit', ['id' => $group->id])
|
||||
return cachet_route('dashboard.components.groups.edit', [$group->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.edit.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Jenssegers\Date\Date;
|
||||
|
||||
@@ -83,7 +82,7 @@ class DashboardController extends Controller
|
||||
*/
|
||||
public function redirectAdmin()
|
||||
{
|
||||
return Redirect::route('dashboard.index');
|
||||
return cachet_route('dashboard');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@ use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
/**
|
||||
@@ -61,13 +60,13 @@ class IncidentController extends Controller
|
||||
$this->subMenu = [
|
||||
'incidents' => [
|
||||
'title' => trans('dashboard.incidents.incidents'),
|
||||
'url' => route('dashboard.incidents.index'),
|
||||
'url' => cachet_route('dashboard.incidents'),
|
||||
'icon' => 'ion-android-checkmark-circle',
|
||||
'active' => true,
|
||||
],
|
||||
'schedule' => [
|
||||
'title' => trans('dashboard.schedule.schedule'),
|
||||
'url' => route('dashboard.schedule.index'),
|
||||
'url' => cachet_route('dashboard.schedule'),
|
||||
'icon' => 'ion-android-calendar',
|
||||
'active' => false,
|
||||
],
|
||||
@@ -139,13 +138,13 @@ class IncidentController extends Controller
|
||||
null
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.incidents.add')
|
||||
return cachet_route('dashboard.incidents.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.incidents.index')
|
||||
return cachet_route('dashboard.incidents')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.add.success')));
|
||||
}
|
||||
|
||||
@@ -185,7 +184,7 @@ class IncidentController extends Controller
|
||||
{
|
||||
$template->delete();
|
||||
|
||||
return Redirect::route('dashboard.templates.index')
|
||||
return cachet_route('dashboard.templates')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success')));
|
||||
}
|
||||
|
||||
@@ -199,13 +198,13 @@ class IncidentController extends Controller
|
||||
try {
|
||||
IncidentTemplate::create(Binput::get('template'));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.templates.add')
|
||||
return cachet_route('dashboard.templates.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.templates.index')
|
||||
return cachet_route('dashboard.templates')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success')));
|
||||
}
|
||||
|
||||
@@ -220,7 +219,7 @@ class IncidentController extends Controller
|
||||
{
|
||||
dispatch(new RemoveIncidentCommand($incident));
|
||||
|
||||
return Redirect::route('dashboard.incidents.index')
|
||||
return cachet_route('dashboard.incidents')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
|
||||
}
|
||||
|
||||
@@ -265,7 +264,7 @@ class IncidentController extends Controller
|
||||
null
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.incidents.edit', ['id' => $incident->id])
|
||||
return cachet_route('dashboard.incidents.edit', ['id' => $incident->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
@@ -275,7 +274,7 @@ class IncidentController extends Controller
|
||||
$incident->component->update(['status' => Binput::get('component_status')]);
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.incidents.edit', ['id' => $incident->id])
|
||||
return cachet_route('dashboard.incidents.edit', ['id' => $incident->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.edit.success')));
|
||||
}
|
||||
|
||||
@@ -291,12 +290,12 @@ class IncidentController extends Controller
|
||||
try {
|
||||
$template->update(Binput::get('template'));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.templates.edit', ['id' => $template->id])
|
||||
return cachet_route('dashboard.templates.edit', ['id' => $template->id])
|
||||
->withUpdatedTemplate($template)
|
||||
->withTemplateErrors($e->getMessageBag()->getErrors());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.templates.edit', ['id' => $template->id])
|
||||
return cachet_route('dashboard.templates.edit', ['id' => $template->id])
|
||||
->withUpdatedTemplate($template);
|
||||
}
|
||||
|
||||
@@ -329,13 +328,13 @@ class IncidentController extends Controller
|
||||
$this->auth->user()
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.incidents.update', ['id' => $incident->id])
|
||||
return cachet_route('dashboard.incidents.update', ['id' => $incident->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.incidents.index')
|
||||
return cachet_route('dashboard.incidents')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class MetricController extends Controller
|
||||
@@ -83,13 +82,13 @@ class MetricController extends Controller
|
||||
$metricData['threshold']
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.metrics.add')
|
||||
return cachet_route('dashboard.metrics.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.metrics.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.metrics.index')
|
||||
return cachet_route('dashboard.metrics')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.add.success')));
|
||||
}
|
||||
|
||||
@@ -115,7 +114,7 @@ class MetricController extends Controller
|
||||
{
|
||||
dispatch(new RemoveMetricCommand($metric));
|
||||
|
||||
return Redirect::route('dashboard.metrics.index')
|
||||
return cachet_route('dashboard.metrics')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success')));
|
||||
}
|
||||
|
||||
@@ -156,13 +155,13 @@ class MetricController extends Controller
|
||||
Binput::get('threshold', null, false)
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id])
|
||||
return cachet_route('dashboard.metrics.edit', [$metric->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('<strong>%s</strong>', trans('dashboard.notifications.whoops')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id])
|
||||
return cachet_route('dashboard.metrics.edit', [$metric->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.edit.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Jenssegers\Date\Date;
|
||||
@@ -42,13 +41,13 @@ class ScheduleController extends Controller
|
||||
$this->subMenu = [
|
||||
'incidents' => [
|
||||
'title' => trans('dashboard.incidents.incidents'),
|
||||
'url' => route('dashboard.incidents.index'),
|
||||
'url' => cachet_route('dashboard.incidents'),
|
||||
'icon' => 'ion-android-checkmark-circle',
|
||||
'active' => false,
|
||||
],
|
||||
'schedule' => [
|
||||
'title' => trans('dashboard.schedule.schedule'),
|
||||
'url' => route('dashboard.schedule.index'),
|
||||
'url' => cachet_route('dashboard.schedule'),
|
||||
'icon' => 'ion-android-calendar',
|
||||
'active' => true,
|
||||
],
|
||||
@@ -101,13 +100,13 @@ class ScheduleController extends Controller
|
||||
Binput::get('scheduled_at')
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.schedule.add')
|
||||
return cachet_route('dashboard.schedule.create')
|
||||
->withInput(Binput::all())
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.schedule.index')
|
||||
return cachet_route('dashboard.schedule')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.add.success')));
|
||||
}
|
||||
|
||||
@@ -146,7 +145,7 @@ class ScheduleController extends Controller
|
||||
$messageBag = new MessageBag();
|
||||
$messageBag->add('scheduled_at', trans('validation.date', ['attribute' => 'scheduled time you supplied']));
|
||||
|
||||
return Redirect::route('dashboard.schedule.edit', ['id' => $schedule->id])->withErrors($messageBag);
|
||||
return cachet_route('dashboard.schedule.edit', [$schedule->id])->withErrors($messageBag);
|
||||
}
|
||||
|
||||
$scheduleData['scheduled_at'] = $scheduledAt;
|
||||
@@ -156,13 +155,13 @@ class ScheduleController extends Controller
|
||||
try {
|
||||
$schedule->update($scheduleData);
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.schedule.edit', ['id' => $schedule->id])
|
||||
return cachet_route('dashboard.schedule.edit', [$schedule->id])
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.schedule.edit', ['id' => $schedule->id])
|
||||
return cachet_route('dashboard.schedule.edit', [$schedule->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.edit.success')));
|
||||
}
|
||||
|
||||
@@ -177,7 +176,7 @@ class ScheduleController extends Controller
|
||||
{
|
||||
$schedule->delete();
|
||||
|
||||
return Redirect::route('dashboard.schedule.index')
|
||||
return cachet_route('dashboard.schedule')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,55 +44,55 @@ class SettingsController extends Controller
|
||||
$this->subMenu = [
|
||||
'setup' => [
|
||||
'title' => trans('dashboard.settings.app-setup.app-setup'),
|
||||
'url' => route('dashboard.settings.setup'),
|
||||
'url' => cachet_route('dashboard.settings.setup'),
|
||||
'icon' => 'ion-gear-b',
|
||||
'active' => false,
|
||||
],
|
||||
'theme' => [
|
||||
'title' => trans('dashboard.settings.theme.theme'),
|
||||
'url' => route('dashboard.settings.theme'),
|
||||
'url' => cachet_route('dashboard.settings.theme'),
|
||||
'icon' => 'ion-paintbrush',
|
||||
'active' => false,
|
||||
],
|
||||
'stylesheet' => [
|
||||
'title' => trans('dashboard.settings.stylesheet.stylesheet'),
|
||||
'url' => route('dashboard.settings.stylesheet'),
|
||||
'url' => cachet_route('dashboard.settings.stylesheet'),
|
||||
'icon' => 'ion-paintbucket',
|
||||
'active' => false,
|
||||
],
|
||||
'customization' => [
|
||||
'title' => trans('dashboard.settings.customization.customization'),
|
||||
'url' => route('dashboard.settings.customization'),
|
||||
'url' => cachet_route('dashboard.settings.customization'),
|
||||
'icon' => 'ion-wand',
|
||||
'active' => false,
|
||||
],
|
||||
'localization' => [
|
||||
'title' => trans('dashboard.settings.localization.localization'),
|
||||
'url' => route('dashboard.settings.localization'),
|
||||
'url' => cachet_route('dashboard.settings.localization'),
|
||||
'icon' => 'ion-earth',
|
||||
'active' => false,
|
||||
],
|
||||
'security' => [
|
||||
'title' => trans('dashboard.settings.security.security'),
|
||||
'url' => route('dashboard.settings.security'),
|
||||
'url' => cachet_route('dashboard.settings.security'),
|
||||
'icon' => 'ion-lock-combination',
|
||||
'active' => false,
|
||||
],
|
||||
'analytics' => [
|
||||
'title' => trans('dashboard.settings.analytics.analytics'),
|
||||
'url' => route('dashboard.settings.analytics'),
|
||||
'url' => cachet_route('dashboard.settings.analytics'),
|
||||
'icon' => 'ion-stats-bars',
|
||||
'active' => false,
|
||||
],
|
||||
'log' => [
|
||||
'title' => trans('dashboard.settings.log.log'),
|
||||
'url' => route('dashboard.settings.log'),
|
||||
'url' => cachet_route('dashboard.settings.log'),
|
||||
'icon' => 'ion-document-text',
|
||||
'active' => false,
|
||||
],
|
||||
'credits' => [
|
||||
'title' => trans('dashboard.settings.credits.credits'),
|
||||
'url' => route('dashboard.settings.credits'),
|
||||
'url' => cachet_route('dashboard.settings.credits'),
|
||||
'icon' => 'ion-ios-list',
|
||||
'active' => false,
|
||||
],
|
||||
|
||||
@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Subscriber;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class SubscriberController extends Controller
|
||||
@@ -62,13 +61,13 @@ class SubscriberController extends Controller
|
||||
dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
|
||||
}
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.subscribers.add')
|
||||
return cachet_route('dashboard.subscribers.create')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.subscribers.add')
|
||||
return cachet_route('dashboard.subscribers.create')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success')));
|
||||
}
|
||||
|
||||
@@ -85,6 +84,6 @@ class SubscriberController extends Controller
|
||||
{
|
||||
dispatch(new UnsubscribeSubscriberCommand($subscriber));
|
||||
|
||||
return Redirect::route('dashboard.subscribers.index');
|
||||
return cachet_route('dashboard.subscribers');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class TeamController extends Controller
|
||||
@@ -88,13 +87,13 @@ class TeamController extends Controller
|
||||
Binput::get('level')
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.team.add')
|
||||
return cachet_route('dashboard.team.create')
|
||||
->withInput(Binput::except('password'))
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.add.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.team.add')
|
||||
return cachet_route('dashboard.team.create')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.add.success')));
|
||||
}
|
||||
|
||||
@@ -112,13 +111,13 @@ class TeamController extends Controller
|
||||
try {
|
||||
$user->update($userData);
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.team.edit', ['id' => $user->id])
|
||||
return cachet_route('dashboard.team.edit', [$user->id])
|
||||
->withInput($userData)
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.team.edit', ['id' => $user->id])
|
||||
return cachet_route('dashboard.team.edit', [$user->id])
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success')));
|
||||
}
|
||||
|
||||
@@ -134,13 +133,13 @@ class TeamController extends Controller
|
||||
array_unique(array_filter((array) Binput::get('emails')))
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.team.invite')
|
||||
return cachet_route('dashboard.team.invite')
|
||||
->withInput(Binput::except('password'))
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.team.invite')
|
||||
return cachet_route('dashboard.team.invite')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.invite.success')));
|
||||
}
|
||||
|
||||
@@ -155,7 +154,7 @@ class TeamController extends Controller
|
||||
{
|
||||
dispatch(new RemoveUserCommand($user));
|
||||
|
||||
return Redirect::route('dashboard.team.index')
|
||||
return cachet_route('dashboard.team')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA;
|
||||
|
||||
@@ -59,13 +58,13 @@ class UserController extends Controller
|
||||
try {
|
||||
Auth::user()->update($userData);
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.user')
|
||||
return cachet_route('dashboard.user')
|
||||
->withInput($userData)
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('dashboard.user')
|
||||
return cachet_route('dashboard.user')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success')));
|
||||
}
|
||||
|
||||
@@ -83,6 +82,6 @@ class UserController extends Controller
|
||||
|
||||
event(new UserRegeneratedApiTokenEvent($user));
|
||||
|
||||
return Redirect::route('dashboard.user');
|
||||
return cachet_route('dashboard.user');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class FeedController extends Controller
|
||||
$this->feed->add(
|
||||
$incident->name,
|
||||
Config::get('setting.app_name'),
|
||||
Str::canonicalize(route('incident', ['id' => $incident->id])),
|
||||
Str::canonicalize(cachet_route('incident', [$incident->id])),
|
||||
$isRss ? $incident->created_at->toRssString() : $incident->created_at->toAtomString(),
|
||||
$isRss ? $incident->message : Markdown::convertToHtml($incident->message)
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@ use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@@ -268,14 +267,14 @@ class SetupController extends Controller
|
||||
return Response::json(['status' => 1]);
|
||||
}
|
||||
|
||||
return Redirect::to('dashboard');
|
||||
return cachet_route('dashboard');
|
||||
}
|
||||
|
||||
if (Request::ajax()) {
|
||||
return Response::json(['errors' => $v->getMessageBag()], 400);
|
||||
}
|
||||
|
||||
return Redirect::route('setup.index')->withInput()->withErrors($v->getMessageBag());
|
||||
return cachet_route('setup')->withInput()->withErrors($v->getMessageBag());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Invite;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -77,7 +76,7 @@ class SignupController extends Controller
|
||||
User::LEVEL_USER
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('signup.invite', ['code' => $invite->code])
|
||||
return cachet_route('signup.invite', [$invite->code])
|
||||
->withInput(Binput::except('password'))
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
@@ -85,7 +84,7 @@ class SignupController extends Controller
|
||||
|
||||
dispatch(new ClaimInviteCommand($invite));
|
||||
|
||||
return Redirect::route('status-page')
|
||||
return cachet_route('status-page')
|
||||
->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
@@ -63,17 +62,17 @@ class SubscribeController extends Controller
|
||||
try {
|
||||
$subscription = dispatch(new SubscribeSubscriberCommand($email, $verified));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('status-page')
|
||||
return cachet_route('status-page')
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
if ($subscription->is_verified) {
|
||||
return Redirect::route('status-page')->withSuccess(trans('cachet.subscriber.email.already-subscribed', ['email' => $email]));
|
||||
return cachet_route('status-page')->withSuccess(trans('cachet.subscriber.email.already-subscribed', ['email' => $email]));
|
||||
}
|
||||
|
||||
return Redirect::route('subscribe.manage', $subscription->verify_code)
|
||||
return cachet_route('subscribe.manage', $subscription->verify_code)
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ class SubscribeController extends Controller
|
||||
dispatch(new VerifySubscriberCommand($subscriber));
|
||||
}
|
||||
|
||||
return Redirect::route('status-page')
|
||||
return cachet_route('status-page')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.verified')));
|
||||
}
|
||||
|
||||
@@ -130,7 +129,7 @@ class SubscribeController extends Controller
|
||||
dispatch(new UnsubscribeSubscriberCommand($subscriber, $subscription));
|
||||
}
|
||||
|
||||
return Redirect::route('status-page')
|
||||
return cachet_route('status-page')
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed')));
|
||||
}
|
||||
|
||||
@@ -185,13 +184,13 @@ class SubscribeController extends Controller
|
||||
try {
|
||||
dispatch(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions')));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('subscribe.manage', $subscriber->verify_code)
|
||||
return cachet_route('subscribe.manage', $subscriber->verify_code)
|
||||
->withInput(Binput::all())
|
||||
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
|
||||
->withErrors($e->getMessageBag());
|
||||
}
|
||||
|
||||
return Redirect::route('subscribe.manage', $subscriber->verify_code)
|
||||
return cachet_route('subscribe.manage', $subscriber->verify_code)
|
||||
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace CachetHQ\Cachet\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
||||
/**
|
||||
* This is the setup already completed middelware class.
|
||||
@@ -55,7 +54,7 @@ class SetupAlreadyCompleted
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if ($this->config->get('setting.app_name')) {
|
||||
return Redirect::route('dashboard.index');
|
||||
return cachet_route('dashboard');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace CachetHQ\Cachet\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
||||
/**
|
||||
* This is the subscribers configured middleware class.
|
||||
@@ -34,7 +33,7 @@ class SubscribersConfigured
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if (!subscribers_enabled()) {
|
||||
return Redirect::route('status-page');
|
||||
return cachet_route('status-page');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
@@ -29,7 +29,11 @@ class ApiRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => ['api']], function (Registrar $router) {
|
||||
$router->group([
|
||||
'namespace' => 'Api',
|
||||
'prefix' => 'api/v1',
|
||||
'middleware' => ['api'],
|
||||
], function (Registrar $router) {
|
||||
$router->group(['middleware' => ['auth.api']], function (Registrar $router) {
|
||||
$router->get('ping', 'GeneralController@ping');
|
||||
$router->get('version', 'GeneralController@version');
|
||||
|
||||
@@ -29,30 +29,35 @@ class AuthRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['as' => 'auth.', 'middleware' => ['web', 'ready'], 'prefix' => 'auth'], function (Registrar $router) {
|
||||
$router->group([
|
||||
'middleware' => ['web', 'ready'],
|
||||
'prefix' => 'auth',
|
||||
], function (Registrar $router) {
|
||||
$router->get('login', [
|
||||
'as' => 'get:auth.login',
|
||||
'middleware' => 'guest',
|
||||
'as' => 'login',
|
||||
'uses' => 'AuthController@showLogin',
|
||||
]);
|
||||
|
||||
$router->post('login', [
|
||||
'as' => 'post:auth.login',
|
||||
'middleware' => ['guest', 'throttle:10,10'],
|
||||
'uses' => 'AuthController@postLogin',
|
||||
]);
|
||||
|
||||
$router->get('2fa', [
|
||||
'as' => 'two-factor',
|
||||
'as' => 'get:auth.two-factor',
|
||||
'uses' => 'AuthController@showTwoFactorAuth',
|
||||
]);
|
||||
|
||||
$router->post('2fa', [
|
||||
'as' => 'post:auth.two-factor',
|
||||
'middleware' => ['throttle:10,10'],
|
||||
'uses' => 'AuthController@postTwoFactor',
|
||||
]);
|
||||
|
||||
$router->get('logout', [
|
||||
'as' => 'logout',
|
||||
'as' => 'get:auth.logout',
|
||||
'uses' => 'AuthController@logoutAction',
|
||||
'middleware' => 'auth',
|
||||
]);
|
||||
|
||||
@@ -33,7 +33,6 @@ class ApiRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.api.',
|
||||
'prefix' => 'dashboard/api',
|
||||
], function (Registrar $router) {
|
||||
$router->get('incidents/templates', 'ApiController@getIncidentTemplate');
|
||||
|
||||
@@ -30,12 +30,15 @@ class BaseRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'auth'], 'namespace' => 'Dashboard'], function (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->group(['prefix' => 'dashboard'], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard',
|
||||
'uses' => 'DashboardController@showDashboard',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -33,39 +33,61 @@ class ComponentRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.components.',
|
||||
'prefix' => 'dashboard/components',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.components',
|
||||
'uses' => 'ComponentController@showComponents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.components.create',
|
||||
'uses' => 'ComponentController@showAddComponent',
|
||||
]);
|
||||
$router->post('add', 'ComponentController@createComponentAction');
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.components.create',
|
||||
'uses' => 'ComponentController@createComponentAction',
|
||||
]);
|
||||
|
||||
$router->get('groups', [
|
||||
'as' => 'groups',
|
||||
'as' => 'get:dashboard.components.groups',
|
||||
'uses' => 'ComponentController@showComponentGroups',
|
||||
]);
|
||||
$router->get('groups/add', [
|
||||
'as' => 'groups.add',
|
||||
|
||||
$router->get('groups/create', [
|
||||
'as' => 'get:dashboard.components.groups.create',
|
||||
'uses' => 'ComponentController@showAddComponentGroup',
|
||||
]);
|
||||
$router->get('groups/edit/{component_group}', [
|
||||
'as' => 'groups.edit',
|
||||
$router->post('groups/create', [
|
||||
'as' => 'post:dashboard.components.groups.create',
|
||||
'uses' => 'ComponentController@postAddComponentGroup',
|
||||
]);
|
||||
|
||||
$router->get('groups/{component_group}', [
|
||||
'as' => 'get:dashboard.components.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',
|
||||
$router->post('groups/{component_group}', [
|
||||
'as' => 'post:dashboard.components.groups.edit',
|
||||
'uses' => 'ComponentController@updateComponentGroupAction',
|
||||
]);
|
||||
$router->delete('groups/{component_group}', [
|
||||
'as' => 'delete:dashboard.components.groups.delete',
|
||||
'uses' => 'ComponentController@deleteComponentGroupAction',
|
||||
]);
|
||||
|
||||
$router->get('{component}', [
|
||||
'as' => 'get:dashboard.components.edit',
|
||||
'uses' => 'ComponentController@showEditComponent',
|
||||
]);
|
||||
$router->delete('{component}/delete', 'ComponentController@deleteComponentAction');
|
||||
$router->post('{component}/edit', 'ComponentController@updateComponentAction');
|
||||
$router->post('{component}', [
|
||||
'as' => 'post:dashboard.components.edit',
|
||||
'uses' => 'ComponentController@updateComponentAction',
|
||||
]);
|
||||
$router->delete('{component}', [
|
||||
'as' => 'delete:dashboard.components.delete',
|
||||
'uses' => 'ComponentController@deleteComponentAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,32 +33,43 @@ class IncidentRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.incidents.',
|
||||
'prefix' => 'dashboard/incidents',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.incidents',
|
||||
'uses' => 'IncidentController@showIncidents',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.incidents.create',
|
||||
'uses' => 'IncidentController@showAddIncident',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
'uses' => 'IncidentController@deleteIncidentAction',
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.incidents.create',
|
||||
'uses' => 'IncidentController@createIncidentAction',
|
||||
]);
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
|
||||
$router->get('{incident}', [
|
||||
'as' => 'get:dashboard.incidents.edit',
|
||||
'uses' => 'IncidentController@showEditIncidentAction',
|
||||
]);
|
||||
$router->get('{incident}/update', [
|
||||
'as' => 'update',
|
||||
$router->post('{incident}', [
|
||||
'as' => 'post:dashboard.incidents.edit',
|
||||
'uses' => 'IncidentController@editIncidentAction',
|
||||
]);
|
||||
$router->delete('{incident}', [
|
||||
'as' => 'delete:dashboard.incidents.delete',
|
||||
'uses' => 'IncidentController@deleteIncidentAction',
|
||||
]);
|
||||
|
||||
$router->get('{incident}/updates', [
|
||||
'as' => 'get:dashboard.incidents.updates',
|
||||
'uses' => 'IncidentController@showIncidentUpdateAction',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'IncidentController@editIncidentAction');
|
||||
$router->post('{incident}/update', 'IncidentController@createIncidentUpdateAction');
|
||||
$router->post('{incident}/updates', [
|
||||
'as' => 'post:dashboard.incidents.updates',
|
||||
'uses' => 'IncidentController@createIncidentUpdateAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,24 +33,34 @@ class MetricRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.metrics.',
|
||||
'prefix' => 'dashboard/metrics',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.metrics',
|
||||
'uses' => 'MetricController@showMetrics',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.metrics.create',
|
||||
'uses' => 'MetricController@showAddMetric',
|
||||
]);
|
||||
$router->post('add', 'MetricController@createMetricAction');
|
||||
$router->delete('{metric}/delete', 'MetricController@deleteMetricAction');
|
||||
$router->get('{metric}/edit', [
|
||||
'as' => 'edit',
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.metrics.create',
|
||||
'uses' => 'MetricController@createMetricAction',
|
||||
]);
|
||||
|
||||
$router->get('{metric}', [
|
||||
'as' => 'get:dashboard.metrics.edit',
|
||||
'uses' => 'MetricController@showEditMetricAction',
|
||||
]);
|
||||
$router->post('{metric}/edit', 'MetricController@editMetricAction');
|
||||
$router->post('{metric}', [
|
||||
'as' => 'post:dashboard.metrics.edit',
|
||||
'uses' => 'MetricController@editMetricAction',
|
||||
]);
|
||||
$router->delete('{metric}', [
|
||||
'as' => 'delete:dashboard.metrics.delete',
|
||||
'uses' => 'MetricController@deleteMetricAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,25 +33,32 @@ class ScheduleRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.schedule.',
|
||||
'prefix' => 'dashboard/schedule',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.schedule',
|
||||
'uses' => 'ScheduleController@showIndex',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.schedule.create',
|
||||
'uses' => 'ScheduleController@showAddSchedule',
|
||||
]);
|
||||
$router->post('add', 'ScheduleController@addScheduleAction');
|
||||
$router->get('{incident}/edit', [
|
||||
'as' => 'edit',
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.schedule.create',
|
||||
'uses' => 'ScheduleController@addScheduleAction',
|
||||
]);
|
||||
|
||||
$router->get('{incident}', [
|
||||
'as' => 'get:dashboard.schedule.edit',
|
||||
'uses' => 'ScheduleController@showEditSchedule',
|
||||
]);
|
||||
$router->post('{incident}/edit', 'ScheduleController@editScheduleAction');
|
||||
$router->delete('{incident}/delete', [
|
||||
'as' => 'delete',
|
||||
$router->post('{incident}', [
|
||||
'as' => 'post:dashboard.schedule.edit',
|
||||
'uses' => 'ScheduleController@editScheduleAction',
|
||||
]);
|
||||
$router->delete('{incident}', [
|
||||
'as' => 'delete:dashboard.schedule.delete',
|
||||
'uses' => 'ScheduleController@deleteScheduleAction',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -33,46 +33,49 @@ class SettingRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.settings.',
|
||||
'prefix' => 'dashboard/settings',
|
||||
], function (Registrar $router) {
|
||||
$router->get('setup', [
|
||||
'as' => 'setup',
|
||||
'as' => 'get:dashboard.settings.setup',
|
||||
'uses' => 'SettingsController@showSetupView',
|
||||
]);
|
||||
$router->get('analytics', [
|
||||
'as' => 'analytics',
|
||||
'as' => 'get:dashboard.settings.analytics',
|
||||
'uses' => 'SettingsController@showAnalyticsView',
|
||||
]);
|
||||
$router->get('localization', [
|
||||
'as' => 'localization',
|
||||
'as' => 'get:dashboard.settings.localization',
|
||||
'uses' => 'SettingsController@showLocalizationView',
|
||||
]);
|
||||
$router->get('security', [
|
||||
'as' => 'security',
|
||||
'as' => 'get:dashboard.settings.security',
|
||||
'uses' => 'SettingsController@showSecurityView',
|
||||
]);
|
||||
$router->get('theme', [
|
||||
'as' => 'theme',
|
||||
'as' => 'get:dashboard.settings.theme',
|
||||
'uses' => 'SettingsController@showThemeView',
|
||||
]);
|
||||
$router->get('stylesheet', [
|
||||
'as' => 'stylesheet',
|
||||
'as' => 'get:dashboard.settings.stylesheet',
|
||||
'uses' => 'SettingsController@showStylesheetView',
|
||||
]);
|
||||
$router->get('customization', [
|
||||
'as' => 'customization',
|
||||
'as' => 'get:dashboard.settings.customization',
|
||||
'uses' => 'SettingsController@showCustomizationView',
|
||||
]);
|
||||
$router->get('credits', [
|
||||
'as' => 'credits',
|
||||
'as' => 'get:dashboard.settings.credits',
|
||||
'uses' => 'SettingsController@showCreditsView',
|
||||
]);
|
||||
$router->get('log', [
|
||||
'as' => 'log',
|
||||
'as' => 'get:dashboard.settings.log',
|
||||
'uses' => 'SettingsController@showLogView',
|
||||
]);
|
||||
$router->post('/', 'SettingsController@postSettings');
|
||||
|
||||
$router->post('/', [
|
||||
'as' => 'post:dashboard.settings',
|
||||
'uses' => 'SettingsController@postSettings',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,19 +33,26 @@ class SubscriberRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.subscribers.',
|
||||
'prefix' => 'dashboard/subscribers',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.subscribers',
|
||||
'uses' => 'SubscriberController@showSubscribers',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.subscribers.create',
|
||||
'uses' => 'SubscriberController@showAddSubscriber',
|
||||
]);
|
||||
$router->post('add', 'SubscriberController@createSubscriberAction');
|
||||
$router->delete('{subscriber}/delete', 'SubscriberController@deleteSubscriberAction');
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.subscribers.create',
|
||||
'uses' => 'SubscriberController@createSubscriberAction',
|
||||
]);
|
||||
|
||||
$router->delete('{subscriber}/delete', [
|
||||
'as' => 'delete:dashbpard.subscribers.delete',
|
||||
'uses' => 'SubscriberController@deleteSubscriberAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,28 +33,44 @@ class TeamRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.team.',
|
||||
'prefix' => 'dashboard/team',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.team',
|
||||
'uses' => 'TeamController@showTeamView',
|
||||
]);
|
||||
|
||||
$router->group(['middleware' => 'admin'], function (Registrar $router) {
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.team.create',
|
||||
'uses' => 'TeamController@showAddTeamMemberView',
|
||||
]);
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.team.create',
|
||||
'uses' => 'TeamController@postAddUser',
|
||||
]);
|
||||
|
||||
$router->get('invite', [
|
||||
'as' => 'invite',
|
||||
'as' => 'get:dashboard.team.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->post('invite', [
|
||||
'as' => 'post:dashboard.team.invite',
|
||||
'uses' => 'TeamController@postInviteUser',
|
||||
]);
|
||||
|
||||
$router->get('{user}', [
|
||||
'as' => 'get:dashboard.team.edit',
|
||||
'uses' => 'TeamController@showTeamMemberView',
|
||||
]);
|
||||
$router->post('{user}', [
|
||||
'as' => 'post::dashboard.team.edit',
|
||||
'uses' => 'TeamController@postUpdateUser',
|
||||
]);
|
||||
$router->delete('{user}', [
|
||||
'as' => 'delete:dashboard.team.delete',
|
||||
'uses' => 'TeamController@deleteUser',
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,24 +33,34 @@ class TemplateRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.templates.',
|
||||
'prefix' => 'dashboard/templates',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'index',
|
||||
'as' => 'get:dashboard.templates',
|
||||
'uses' => 'IncidentController@showTemplates',
|
||||
]);
|
||||
$router->get('add', [
|
||||
'as' => 'add',
|
||||
|
||||
$router->get('create', [
|
||||
'as' => 'get:dashboard.templates.create',
|
||||
'uses' => 'IncidentController@showAddIncidentTemplate',
|
||||
]);
|
||||
$router->post('add', 'IncidentController@createIncidentTemplateAction');
|
||||
$router->get('{incident_template}/edit', [
|
||||
'as' => 'edit',
|
||||
$router->post('create', [
|
||||
'as' => 'post:dashboard.templates.create',
|
||||
'uses' => 'IncidentController@createIncidentTemplateAction',
|
||||
]);
|
||||
|
||||
$router->get('{incident_template}', [
|
||||
'as' => 'get:dashboard.templates.edit',
|
||||
'uses' => 'IncidentController@showEditTemplateAction',
|
||||
]);
|
||||
$router->post('{incident_template}/edit', 'IncidentController@editTemplateAction');
|
||||
$router->delete('{incident_template}/delete', 'IncidentController@deleteTemplateAction');
|
||||
$router->post('{incident_template}', [
|
||||
'as' => 'post:dashboard.templates.edit',
|
||||
'uses' => 'IncidentController@editTemplateAction',
|
||||
]);
|
||||
$router->delete('{incident_template}', [
|
||||
'as' => 'delete::dashboard.templates.delete',
|
||||
'uses' => 'IncidentController@deleteTemplateAction',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,21 @@ class UserRoutes
|
||||
$router->group([
|
||||
'middleware' => ['web', 'auth'],
|
||||
'namespace' => 'Dashboard',
|
||||
'as' => 'dashboard.user.',
|
||||
'prefix' => 'dashboard/user',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'user',
|
||||
'as' => 'get:dashboard.user',
|
||||
'uses' => 'UserController@showUser',
|
||||
]);
|
||||
$router->post('/', 'UserController@postUser');
|
||||
$router->get('{user}/api/regen', 'UserController@regenerateApiKey');
|
||||
$router->post('/', [
|
||||
'as' => 'post:dashboard.user',
|
||||
'uses' => 'UserController@postUser',
|
||||
]);
|
||||
|
||||
$router->get('{user}/api/regen', [
|
||||
'as' => 'get:dashboard.user.api.regen',
|
||||
'uses' => 'UserController@regenerateApiKey',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,16 @@ class FeedRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'ready'], 'as' => 'feed.'], function (Registrar $router) {
|
||||
$router->group([
|
||||
'middleware' => ['web', 'ready'],
|
||||
], function (Registrar $router) {
|
||||
$router->get('/atom/{component_group?}', [
|
||||
'as' => 'atom',
|
||||
'as' => 'get:feed.atom',
|
||||
'uses' => 'FeedController@atomAction',
|
||||
]);
|
||||
|
||||
$router->get('/rss/{component_group?}', [
|
||||
'as' => 'rss',
|
||||
'as' => 'get:feed.rss',
|
||||
'uses' => 'FeedController@rssAction',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -30,11 +30,29 @@ class SetupRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'setup']], function (Registrar $router) {
|
||||
$router->get('setup', 'SetupController@getIndex');
|
||||
$router->post('setup/step1', 'SetupController@postStep1');
|
||||
$router->post('setup/step2', 'SetupController@postStep2');
|
||||
$router->post('setup/step3', 'SetupController@postStep3');
|
||||
$router->group([
|
||||
'middleware' => ['web', 'setup'],
|
||||
'prefix' => 'setup',
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'get:setup',
|
||||
'uses' => 'SetupController@getIndex',
|
||||
]);
|
||||
|
||||
$router->post('step1', [
|
||||
'as' => 'post:setup.step1',
|
||||
'uses' => 'SetupController@postStep1',
|
||||
]);
|
||||
|
||||
$router->post('step2', [
|
||||
'as' => 'post:setup.step2',
|
||||
'uses' => 'SetupController@postStep2',
|
||||
]);
|
||||
|
||||
$router->post('step3', [
|
||||
'as' => 'post:setup.step3',
|
||||
'uses' => 'SetupController@postStep3',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,17 @@ class SignupRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'ready', 'guest'], 'as' => 'signup.'], function (Registrar $router) {
|
||||
$router->get('signup/invite/{code}', [
|
||||
'as' => 'invite',
|
||||
$router->group([
|
||||
'middleware' => ['web', 'ready', 'guest'],
|
||||
'prefix' => 'signup',
|
||||
], function (Registrar $router) {
|
||||
$router->get('invite/{code}', [
|
||||
'as' => 'get:signup.invite',
|
||||
'uses' => 'SignupController@getSignup',
|
||||
]);
|
||||
|
||||
$router->post('signup/invite/{code}', [
|
||||
$router->post('invite/{code}', [
|
||||
'as' => 'post:signup.invite',
|
||||
'uses' => 'SignupController@postSignup',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -29,23 +29,28 @@ class StatusPageRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'ready', 'localize']], function (Registrar $router) {
|
||||
$router->group([
|
||||
'middleware' => ['web', 'ready', 'localize'],
|
||||
], function (Registrar $router) {
|
||||
$router->get('/', [
|
||||
'as' => 'status-page',
|
||||
'as' => 'get:status-page',
|
||||
'uses' => 'StatusPageController@showIndex',
|
||||
]);
|
||||
|
||||
$router->get('incident/{incident}', [
|
||||
'as' => 'incident',
|
||||
$router->get('incidents/{incident}', [
|
||||
'as' => 'get:incident',
|
||||
'uses' => 'StatusPageController@showIncident',
|
||||
]);
|
||||
|
||||
$router->get('metrics/{metric}', [
|
||||
'as' => 'metrics',
|
||||
'as' => 'get:metric',
|
||||
'uses' => 'StatusPageController@getMetrics',
|
||||
]);
|
||||
|
||||
$router->get('component/{component}/shield', 'StatusPageController@showComponentBadge');
|
||||
$router->get('component/{component}/shield', [
|
||||
'as' => 'get:component_shield',
|
||||
'uses' => 'StatusPageController@showComponentBadge',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,33 +29,34 @@ class SubscribeRoutes
|
||||
*/
|
||||
public function map(Registrar $router)
|
||||
{
|
||||
$router->group(['middleware' => ['web', 'ready', 'localize', 'subscribers'], 'as' => 'subscribe.'], function (Registrar $router) {
|
||||
$router->group([
|
||||
'middleware' => ['web', 'ready', 'localize', 'subscribers'],
|
||||
], function (Registrar $router) {
|
||||
$router->get('subscribe', [
|
||||
'as' => 'subscribe',
|
||||
'as' => 'get:subscribe',
|
||||
'uses' => 'SubscribeController@showSubscribe',
|
||||
]);
|
||||
|
||||
$router->post('subscribe', [
|
||||
'as' => 'post:subscribe',
|
||||
'uses' => 'SubscribeController@postSubscribe',
|
||||
]);
|
||||
|
||||
$router->get('subscribe/manage/{code}', [
|
||||
'as' => 'manage',
|
||||
'as' => 'get:subscribe.manage',
|
||||
'uses' => 'SubscribeController@showManage',
|
||||
]);
|
||||
|
||||
$router->post('subscribe/manage/{code}', [
|
||||
'as' => 'manage',
|
||||
'as' => 'post:subscribe.manage',
|
||||
'uses' => 'SubscribeController@postManage',
|
||||
]);
|
||||
|
||||
$router->get('subscribe/verify/{code}', [
|
||||
'as' => 'verify',
|
||||
'as' => 'get:subscribe.verify',
|
||||
'uses' => 'SubscribeController@getVerify',
|
||||
]);
|
||||
|
||||
$router->get('unsubscribe/{code}/{subscription?}', [
|
||||
'as' => 'unsubscribe',
|
||||
'as' => 'get:subscribe.unsubscribe',
|
||||
'uses' => 'SubscribeController@getUnsubscribe',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user