Completely refactor all routes

This commit is contained in:
James Brooks
2016-10-12 21:31:07 +01:00
parent 446e428486
commit 5a9f6134c4
90 changed files with 486 additions and 341 deletions

View File

@@ -105,7 +105,7 @@ class SendComponentUpdateEmailNotificationHandler
]; ];
$mail['email'] = $subscriber->email; $mail['email'] = $subscriber->email;
$mail['manage_link'] = route('subscribe.manage', ['code' => $subscriber->verify_code]); $mail['manage_link'] = cachet_route('subscribe.manage', [$subscriber->verify_code]);
$this->mailer->queue([ $this->mailer->queue([
'html' => 'emails.components.update-html', 'html' => 'emails.components.update-html',

View File

@@ -119,8 +119,8 @@ class SendIncidentEmailNotificationHandler
'html_content' => $incident->formattedMessage, 'html_content' => $incident->formattedMessage,
'text_content' => $incident->message, 'text_content' => $incident->message,
'token' => $subscriber->token, 'token' => $subscriber->token,
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]), 'manage_link' => cachet_route('subscribe.manage', [$subscriber->verify_code]),
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]), 'unsubscribe_link' => cachet_route('subscribe.unsubscribe', [$subscriber->verify_code]),
]; ];
$this->mailer->queue([ $this->mailer->queue([

View File

@@ -116,8 +116,8 @@ class SendMaintenanceEmailNotificationHandler
'html_content' => $incident->formattedMessage, 'html_content' => $incident->formattedMessage,
'text_content' => $incident->message, 'text_content' => $incident->message,
'token' => $subscriber->token, 'token' => $subscriber->token,
'manage_link' => route('subscribe.manage', ['code' => $subscriber->verify_code]), 'manage_link' => cachet_route('subscribe.manage', [$subscriber->verify_code]),
'unsubscribe_link' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]), 'unsubscribe_link' => cachet_route('subscribe.unsubscribe', [$subscriber->verify_code]),
]; ];
$this->mailer->queue([ $this->mailer->queue([

View File

@@ -48,7 +48,7 @@ class SendInviteUserEmailHandler
$mail = [ $mail = [
'email' => $event->invite->email, 'email' => $event->invite->email,
'subject' => 'You have been invited.', 'subject' => 'You have been invited.',
'link' => route('signup.invite', ['code' => $event->invite->code]), 'link' => cachet_route('signup.invite', [$event->invite->code]),
]; ];
$this->mailer->queue([ $this->mailer->queue([

View File

@@ -14,6 +14,13 @@ namespace CachetHQ\Cachet\Foundation\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Routing\Router; use Illuminate\Routing\Router;
/**
* This is the route service provider.
*
* @author James Brooks <james@alt-three.com>
* @author Joseph Cohen <joe@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
/** /**
@@ -67,7 +74,7 @@ class RouteServiceProvider extends ServiceProvider
*/ */
public function map(Router $router) public function map(Router $router)
{ {
$router->group(['namespace' => $this->namespace], function (Router $router) { $router->group(['namespace' => $this->namespace, 'as' => 'core::'], function (Router $router) {
$path = app_path('Http/Routes'); $path = app_path('Http/Routes');
foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) { foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) {

View File

@@ -58,17 +58,17 @@ class AuthController extends Controller
if (Auth::user()->hasTwoFactor) { if (Auth::user()->hasTwoFactor) {
Session::put('2fa_id', Auth::user()->id); Session::put('2fa_id', Auth::user()->id);
return Redirect::route('auth.two-factor'); return cachet_route('auth.two-factor');
} }
Auth::attempt($loginData, $rememberUser); Auth::attempt($loginData, $rememberUser);
event(new UserLoggedInEvent(Auth::user())); 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')) ->withInput(Binput::except('password'))
->withError(trans('forms.login.invalid')); ->withError(trans('forms.login.invalid'));
} }
@@ -113,11 +113,11 @@ class AuthController extends Controller
// Failed login, log back out. // Failed login, log back out.
Auth::logout(); 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'));
} }
/** /**

View File

@@ -23,7 +23,6 @@ use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Tag; use CachetHQ\Cachet\Models\Tag;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
class ComponentController extends Controller class ComponentController extends Controller
@@ -45,13 +44,13 @@ class ComponentController extends Controller
$this->subMenu = [ $this->subMenu = [
'components' => [ 'components' => [
'title' => trans('dashboard.components.components'), 'title' => trans('dashboard.components.components'),
'url' => route('dashboard.components.index'), 'url' => cachet_route('dashboard.components'),
'icon' => 'ion-ios-browsers', 'icon' => 'ion-ios-browsers',
'active' => false, 'active' => false,
], ],
'groups' => [ 'groups' => [
'title' => trans_choice('dashboard.components.groups.groups', 2), 'title' => trans_choice('dashboard.components.groups.groups', 2),
'url' => route('dashboard.components.groups'), 'url' => cachet_route('dashboard.components.groups'),
'icon' => 'ion-folder', 'icon' => 'ion-folder',
'active' => false, 'active' => false,
], ],
@@ -138,7 +137,7 @@ class ComponentController extends Controller
$componentData['enabled'] $componentData['enabled']
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.components.edit', ['id' => $component->id]) return cachet_route('dashboard.components.edit', [$component->id])
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.edit.failure')))
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
@@ -154,7 +153,7 @@ class ComponentController extends Controller
$component->tags()->sync($componentTags); $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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.edit.success')));
} }
@@ -191,7 +190,7 @@ class ComponentController extends Controller
$componentData['enabled'] $componentData['enabled']
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.components.add') return cachet_route('dashboard.components.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.add.failure')))
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
@@ -207,7 +206,7 @@ class ComponentController extends Controller
$component->tags()->sync($componentTags); $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'))); ->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)); 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'))); ->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)); 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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success')));
} }
@@ -281,13 +280,13 @@ class ComponentController extends Controller
Binput::get('visible') Binput::get('visible')
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.components.groups.add') return cachet_route('dashboard.components.groups.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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') Binput::get('visible')
)); ));
} catch (ValidationException $e) { } 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()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.edit.success')));
} }
} }

View File

@@ -21,7 +21,6 @@ use Illuminate\Contracts\Auth\Guard;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Jenssegers\Date\Date; use Jenssegers\Date\Date;
@@ -83,7 +82,7 @@ class DashboardController extends Controller
*/ */
public function redirectAdmin() public function redirectAdmin()
{ {
return Redirect::route('dashboard.index'); return cachet_route('dashboard');
} }
/** /**

View File

@@ -23,7 +23,6 @@ use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Guard;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
/** /**
@@ -61,13 +60,13 @@ class IncidentController extends Controller
$this->subMenu = [ $this->subMenu = [
'incidents' => [ 'incidents' => [
'title' => trans('dashboard.incidents.incidents'), 'title' => trans('dashboard.incidents.incidents'),
'url' => route('dashboard.incidents.index'), 'url' => cachet_route('dashboard.incidents'),
'icon' => 'ion-android-checkmark-circle', 'icon' => 'ion-android-checkmark-circle',
'active' => true, 'active' => true,
], ],
'schedule' => [ 'schedule' => [
'title' => trans('dashboard.schedule.schedule'), 'title' => trans('dashboard.schedule.schedule'),
'url' => route('dashboard.schedule.index'), 'url' => cachet_route('dashboard.schedule'),
'icon' => 'ion-android-calendar', 'icon' => 'ion-android-calendar',
'active' => false, 'active' => false,
], ],
@@ -139,13 +138,13 @@ class IncidentController extends Controller
null null
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.incidents.add') return cachet_route('dashboard.incidents.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.add.success')));
} }
@@ -185,7 +184,7 @@ class IncidentController extends Controller
{ {
$template->delete(); $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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success')));
} }
@@ -199,13 +198,13 @@ class IncidentController extends Controller
try { try {
IncidentTemplate::create(Binput::get('template')); IncidentTemplate::create(Binput::get('template'));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.templates.add') return cachet_route('dashboard.templates.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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)); 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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
} }
@@ -265,7 +264,7 @@ class IncidentController extends Controller
null null
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.incidents.edit', ['id' => $incident->id]) return cachet_route('dashboard.incidents.edit', ['id' => $incident->id])
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
@@ -275,7 +274,7 @@ class IncidentController extends Controller
$incident->component->update(['status' => Binput::get('component_status')]); $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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.edit.success')));
} }
@@ -291,12 +290,12 @@ class IncidentController extends Controller
try { try {
$template->update(Binput::get('template')); $template->update(Binput::get('template'));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.templates.edit', ['id' => $template->id]) return cachet_route('dashboard.templates.edit', ['id' => $template->id])
->withUpdatedTemplate($template) ->withUpdatedTemplate($template)
->withTemplateErrors($e->getMessageBag()->getErrors()); ->withTemplateErrors($e->getMessageBag()->getErrors());
} }
return Redirect::route('dashboard.templates.edit', ['id' => $template->id]) return cachet_route('dashboard.templates.edit', ['id' => $template->id])
->withUpdatedTemplate($template); ->withUpdatedTemplate($template);
} }
@@ -329,13 +328,13 @@ class IncidentController extends Controller
$this->auth->user() $this->auth->user()
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.incidents.update', ['id' => $incident->id]) return cachet_route('dashboard.incidents.update', ['id' => $incident->id])
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
} }
} }

View File

@@ -19,7 +19,6 @@ use CachetHQ\Cachet\Models\Metric;
use CachetHQ\Cachet\Models\MetricPoint; use CachetHQ\Cachet\Models\MetricPoint;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
class MetricController extends Controller class MetricController extends Controller
@@ -83,13 +82,13 @@ class MetricController extends Controller
$metricData['threshold'] $metricData['threshold']
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.metrics.add') return cachet_route('dashboard.metrics.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.metrics.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.metrics.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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)); 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'))); ->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) Binput::get('threshold', null, false)
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id]) return cachet_route('dashboard.metrics.edit', [$metric->id])
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('<strong>%s</strong>', trans('dashboard.notifications.whoops'))) ->withTitle(sprintf('<strong>%s</strong>', trans('dashboard.notifications.whoops')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.edit.success')));
} }
} }

View File

@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate; use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Illuminate\Support\MessageBag; use Illuminate\Support\MessageBag;
use Jenssegers\Date\Date; use Jenssegers\Date\Date;
@@ -42,13 +41,13 @@ class ScheduleController extends Controller
$this->subMenu = [ $this->subMenu = [
'incidents' => [ 'incidents' => [
'title' => trans('dashboard.incidents.incidents'), 'title' => trans('dashboard.incidents.incidents'),
'url' => route('dashboard.incidents.index'), 'url' => cachet_route('dashboard.incidents'),
'icon' => 'ion-android-checkmark-circle', 'icon' => 'ion-android-checkmark-circle',
'active' => false, 'active' => false,
], ],
'schedule' => [ 'schedule' => [
'title' => trans('dashboard.schedule.schedule'), 'title' => trans('dashboard.schedule.schedule'),
'url' => route('dashboard.schedule.index'), 'url' => cachet_route('dashboard.schedule'),
'icon' => 'ion-android-calendar', 'icon' => 'ion-android-calendar',
'active' => true, 'active' => true,
], ],
@@ -101,13 +100,13 @@ class ScheduleController extends Controller
Binput::get('scheduled_at') Binput::get('scheduled_at')
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.schedule.add') return cachet_route('dashboard.schedule.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.add.failure'))) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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 = new MessageBag();
$messageBag->add('scheduled_at', trans('validation.date', ['attribute' => 'scheduled time you supplied'])); $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; $scheduleData['scheduled_at'] = $scheduledAt;
@@ -156,13 +155,13 @@ class ScheduleController extends Controller
try { try {
$schedule->update($scheduleData); $schedule->update($scheduleData);
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.schedule.edit', ['id' => $schedule->id]) return cachet_route('dashboard.schedule.edit', [$schedule->id])
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.edit.success')));
} }
@@ -177,7 +176,7 @@ class ScheduleController extends Controller
{ {
$schedule->delete(); $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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success')));
} }
} }

View File

@@ -44,55 +44,55 @@ class SettingsController extends Controller
$this->subMenu = [ $this->subMenu = [
'setup' => [ 'setup' => [
'title' => trans('dashboard.settings.app-setup.app-setup'), 'title' => trans('dashboard.settings.app-setup.app-setup'),
'url' => route('dashboard.settings.setup'), 'url' => cachet_route('dashboard.settings.setup'),
'icon' => 'ion-gear-b', 'icon' => 'ion-gear-b',
'active' => false, 'active' => false,
], ],
'theme' => [ 'theme' => [
'title' => trans('dashboard.settings.theme.theme'), 'title' => trans('dashboard.settings.theme.theme'),
'url' => route('dashboard.settings.theme'), 'url' => cachet_route('dashboard.settings.theme'),
'icon' => 'ion-paintbrush', 'icon' => 'ion-paintbrush',
'active' => false, 'active' => false,
], ],
'stylesheet' => [ 'stylesheet' => [
'title' => trans('dashboard.settings.stylesheet.stylesheet'), 'title' => trans('dashboard.settings.stylesheet.stylesheet'),
'url' => route('dashboard.settings.stylesheet'), 'url' => cachet_route('dashboard.settings.stylesheet'),
'icon' => 'ion-paintbucket', 'icon' => 'ion-paintbucket',
'active' => false, 'active' => false,
], ],
'customization' => [ 'customization' => [
'title' => trans('dashboard.settings.customization.customization'), 'title' => trans('dashboard.settings.customization.customization'),
'url' => route('dashboard.settings.customization'), 'url' => cachet_route('dashboard.settings.customization'),
'icon' => 'ion-wand', 'icon' => 'ion-wand',
'active' => false, 'active' => false,
], ],
'localization' => [ 'localization' => [
'title' => trans('dashboard.settings.localization.localization'), 'title' => trans('dashboard.settings.localization.localization'),
'url' => route('dashboard.settings.localization'), 'url' => cachet_route('dashboard.settings.localization'),
'icon' => 'ion-earth', 'icon' => 'ion-earth',
'active' => false, 'active' => false,
], ],
'security' => [ 'security' => [
'title' => trans('dashboard.settings.security.security'), 'title' => trans('dashboard.settings.security.security'),
'url' => route('dashboard.settings.security'), 'url' => cachet_route('dashboard.settings.security'),
'icon' => 'ion-lock-combination', 'icon' => 'ion-lock-combination',
'active' => false, 'active' => false,
], ],
'analytics' => [ 'analytics' => [
'title' => trans('dashboard.settings.analytics.analytics'), 'title' => trans('dashboard.settings.analytics.analytics'),
'url' => route('dashboard.settings.analytics'), 'url' => cachet_route('dashboard.settings.analytics'),
'icon' => 'ion-stats-bars', 'icon' => 'ion-stats-bars',
'active' => false, 'active' => false,
], ],
'log' => [ 'log' => [
'title' => trans('dashboard.settings.log.log'), 'title' => trans('dashboard.settings.log.log'),
'url' => route('dashboard.settings.log'), 'url' => cachet_route('dashboard.settings.log'),
'icon' => 'ion-document-text', 'icon' => 'ion-document-text',
'active' => false, 'active' => false,
], ],
'credits' => [ 'credits' => [
'title' => trans('dashboard.settings.credits.credits'), 'title' => trans('dashboard.settings.credits.credits'),
'url' => route('dashboard.settings.credits'), 'url' => cachet_route('dashboard.settings.credits'),
'icon' => 'ion-ios-list', 'icon' => 'ion-ios-list',
'active' => false, 'active' => false,
], ],

View File

@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Subscriber;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Config\Repository;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
class SubscriberController extends Controller class SubscriberController extends Controller
@@ -62,13 +61,13 @@ class SubscriberController extends Controller
dispatch(new SubscribeSubscriberCommand($subscriber, $verified)); dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
} }
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.subscribers.add') return cachet_route('dashboard.subscribers.create')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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)); dispatch(new UnsubscribeSubscriberCommand($subscriber));
return Redirect::route('dashboard.subscribers.index'); return cachet_route('dashboard.subscribers');
} }
} }

View File

@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
use CachetHQ\Cachet\Models\User; use CachetHQ\Cachet\Models\User;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
class TeamController extends Controller class TeamController extends Controller
@@ -88,13 +87,13 @@ class TeamController extends Controller
Binput::get('level') Binput::get('level')
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.team.add') return cachet_route('dashboard.team.create')
->withInput(Binput::except('password')) ->withInput(Binput::except('password'))
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.add.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.add.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.add.success')));
} }
@@ -112,13 +111,13 @@ class TeamController extends Controller
try { try {
$user->update($userData); $user->update($userData);
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.team.edit', ['id' => $user->id]) return cachet_route('dashboard.team.edit', [$user->id])
->withInput($userData) ->withInput($userData)
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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'))) array_unique(array_filter((array) Binput::get('emails')))
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.team.invite') return cachet_route('dashboard.team.invite')
->withInput(Binput::except('password')) ->withInput(Binput::except('password'))
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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)); 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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success')));
} }
} }

View File

@@ -19,7 +19,6 @@ use CachetHQ\Cachet\Models\User;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA; use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA;
@@ -59,13 +58,13 @@ class UserController extends Controller
try { try {
Auth::user()->update($userData); Auth::user()->update($userData);
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('dashboard.user') return cachet_route('dashboard.user')
->withInput($userData) ->withInput($userData)
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->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)); event(new UserRegeneratedApiTokenEvent($user));
return Redirect::route('dashboard.user'); return cachet_route('dashboard.user');
} }
} }

View File

@@ -104,7 +104,7 @@ class FeedController extends Controller
$this->feed->add( $this->feed->add(
$incident->name, $incident->name,
Config::get('setting.app_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->created_at->toRssString() : $incident->created_at->toAtomString(),
$isRss ? $incident->message : Markdown::convertToHtml($incident->message) $isRss ? $incident->message : Markdown::convertToHtml($incident->message)
); );

View File

@@ -19,7 +19,6 @@ use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
@@ -268,14 +267,14 @@ class SetupController extends Controller
return Response::json(['status' => 1]); return Response::json(['status' => 1]);
} }
return Redirect::to('dashboard'); return cachet_route('dashboard');
} }
if (Request::ajax()) { if (Request::ajax()) {
return Response::json(['errors' => $v->getMessageBag()], 400); return Response::json(['errors' => $v->getMessageBag()], 400);
} }
return Redirect::route('setup.index')->withInput()->withErrors($v->getMessageBag()); return cachet_route('setup')->withInput()->withErrors($v->getMessageBag());
} }
/** /**

View File

@@ -18,7 +18,6 @@ use CachetHQ\Cachet\Models\Invite;
use CachetHQ\Cachet\Models\User; use CachetHQ\Cachet\Models\User;
use GrahamCampbell\Binput\Facades\Binput; use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -77,7 +76,7 @@ class SignupController extends Controller
User::LEVEL_USER User::LEVEL_USER
)); ));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('signup.invite', ['code' => $invite->code]) return cachet_route('signup.invite', [$invite->code])
->withInput(Binput::except('password')) ->withInput(Binput::except('password'))
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure')))
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
@@ -85,7 +84,7 @@ class SignupController extends Controller
dispatch(new ClaimInviteCommand($invite)); 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'))); ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));
} }
} }

View File

@@ -26,7 +26,6 @@ use GrahamCampbell\Markdown\Facades\Markdown;
use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Config\Repository;
use Illuminate\Routing\Controller; use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -63,17 +62,17 @@ class SubscribeController extends Controller
try { try {
$subscription = dispatch(new SubscribeSubscriberCommand($email, $verified)); $subscription = dispatch(new SubscribeSubscriberCommand($email, $verified));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('status-page') return cachet_route('status-page')
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
->withErrors($e->getMessageBag()); ->withErrors($e->getMessageBag());
} }
if ($subscription->is_verified) { 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'))); ->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)); 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'))); ->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)); 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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed')));
} }
@@ -185,13 +184,13 @@ class SubscribeController extends Controller
try { try {
dispatch(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions'))); dispatch(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions')));
} catch (ValidationException $e) { } catch (ValidationException $e) {
return Redirect::route('subscribe.manage', $subscriber->verify_code) return cachet_route('subscribe.manage', $subscriber->verify_code)
->withInput(Binput::all()) ->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure'))) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
->withErrors($e->getMessageBag()); ->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'))); ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
} }
} }

View File

@@ -14,7 +14,6 @@ namespace CachetHQ\Cachet\Http\Middleware;
use Closure; use Closure;
use Illuminate\Contracts\Config\Repository; use Illuminate\Contracts\Config\Repository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
/** /**
* This is the setup already completed middelware class. * This is the setup already completed middelware class.
@@ -55,7 +54,7 @@ class SetupAlreadyCompleted
public function handle(Request $request, Closure $next) public function handle(Request $request, Closure $next)
{ {
if ($this->config->get('setting.app_name')) { if ($this->config->get('setting.app_name')) {
return Redirect::route('dashboard.index'); return cachet_route('dashboard');
} }
return $next($request); return $next($request);

View File

@@ -13,7 +13,6 @@ namespace CachetHQ\Cachet\Http\Middleware;
use Closure; use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
/** /**
* This is the subscribers configured middleware class. * This is the subscribers configured middleware class.
@@ -34,7 +33,7 @@ class SubscribersConfigured
public function handle(Request $request, Closure $next) public function handle(Request $request, Closure $next)
{ {
if (!subscribers_enabled()) { if (!subscribers_enabled()) {
return Redirect::route('status-page'); return cachet_route('status-page');
} }
return $next($request); return $next($request);

View File

@@ -29,7 +29,11 @@ class ApiRoutes
*/ */
public function map(Registrar $router) 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->group(['middleware' => ['auth.api']], function (Registrar $router) {
$router->get('ping', 'GeneralController@ping'); $router->get('ping', 'GeneralController@ping');
$router->get('version', 'GeneralController@version'); $router->get('version', 'GeneralController@version');

View File

@@ -29,30 +29,35 @@ class AuthRoutes
*/ */
public function map(Registrar $router) 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', [ $router->get('login', [
'as' => 'get:auth.login',
'middleware' => 'guest', 'middleware' => 'guest',
'as' => 'login',
'uses' => 'AuthController@showLogin', 'uses' => 'AuthController@showLogin',
]); ]);
$router->post('login', [ $router->post('login', [
'as' => 'post:auth.login',
'middleware' => ['guest', 'throttle:10,10'], 'middleware' => ['guest', 'throttle:10,10'],
'uses' => 'AuthController@postLogin', 'uses' => 'AuthController@postLogin',
]); ]);
$router->get('2fa', [ $router->get('2fa', [
'as' => 'two-factor', 'as' => 'get:auth.two-factor',
'uses' => 'AuthController@showTwoFactorAuth', 'uses' => 'AuthController@showTwoFactorAuth',
]); ]);
$router->post('2fa', [ $router->post('2fa', [
'as' => 'post:auth.two-factor',
'middleware' => ['throttle:10,10'], 'middleware' => ['throttle:10,10'],
'uses' => 'AuthController@postTwoFactor', 'uses' => 'AuthController@postTwoFactor',
]); ]);
$router->get('logout', [ $router->get('logout', [
'as' => 'logout', 'as' => 'get:auth.logout',
'uses' => 'AuthController@logoutAction', 'uses' => 'AuthController@logoutAction',
'middleware' => 'auth', 'middleware' => 'auth',
]); ]);

View File

@@ -33,7 +33,6 @@ class ApiRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.api.',
'prefix' => 'dashboard/api', 'prefix' => 'dashboard/api',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('incidents/templates', 'ApiController@getIncidentTemplate'); $router->get('incidents/templates', 'ApiController@getIncidentTemplate');

View File

@@ -30,12 +30,15 @@ class BaseRoutes
*/ */
public function map(Registrar $router) 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->get('admin', 'DashboardController@redirectAdmin');
$router->group(['prefix' => 'dashboard', 'as' => 'dashboard.'], function (Registrar $router) { $router->group(['prefix' => 'dashboard'], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard',
'uses' => 'DashboardController@showDashboard', 'uses' => 'DashboardController@showDashboard',
]); ]);
}); });

View File

@@ -33,39 +33,61 @@ class ComponentRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.components.',
'prefix' => 'dashboard/components', 'prefix' => 'dashboard/components',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.components',
'uses' => 'ComponentController@showComponents', 'uses' => 'ComponentController@showComponents',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.components.create',
'uses' => 'ComponentController@showAddComponent', 'uses' => 'ComponentController@showAddComponent',
]); ]);
$router->post('add', 'ComponentController@createComponentAction'); $router->post('create', [
'as' => 'post:dashboard.components.create',
'uses' => 'ComponentController@createComponentAction',
]);
$router->get('groups', [ $router->get('groups', [
'as' => 'groups', 'as' => 'get:dashboard.components.groups',
'uses' => 'ComponentController@showComponentGroups', 'uses' => 'ComponentController@showComponentGroups',
]); ]);
$router->get('groups/add', [
'as' => 'groups.add', $router->get('groups/create', [
'as' => 'get:dashboard.components.groups.create',
'uses' => 'ComponentController@showAddComponentGroup', 'uses' => 'ComponentController@showAddComponentGroup',
]); ]);
$router->get('groups/edit/{component_group}', [ $router->post('groups/create', [
'as' => 'groups.edit', 'as' => 'post:dashboard.components.groups.create',
'uses' => 'ComponentController@postAddComponentGroup',
]);
$router->get('groups/{component_group}', [
'as' => 'get:dashboard.components.groups.edit',
'uses' => 'ComponentController@showEditComponentGroup', 'uses' => 'ComponentController@showEditComponentGroup',
]); ]);
$router->post('groups/edit/{component_group}', 'ComponentController@updateComponentGroupAction'); $router->post('groups/{component_group}', [
$router->delete('groups/{component_group}/delete', 'ComponentController@deleteComponentGroupAction'); 'as' => 'post:dashboard.components.groups.edit',
$router->post('groups/add', 'ComponentController@postAddComponentGroup'); 'uses' => 'ComponentController@updateComponentGroupAction',
$router->get('{component}/edit', [ ]);
'as' => 'edit', $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', 'uses' => 'ComponentController@showEditComponent',
]); ]);
$router->delete('{component}/delete', 'ComponentController@deleteComponentAction'); $router->post('{component}', [
$router->post('{component}/edit', 'ComponentController@updateComponentAction'); 'as' => 'post:dashboard.components.edit',
'uses' => 'ComponentController@updateComponentAction',
]);
$router->delete('{component}', [
'as' => 'delete:dashboard.components.delete',
'uses' => 'ComponentController@deleteComponentAction',
]);
}); });
} }
} }

View File

@@ -33,32 +33,43 @@ class IncidentRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.incidents.',
'prefix' => 'dashboard/incidents', 'prefix' => 'dashboard/incidents',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.incidents',
'uses' => 'IncidentController@showIncidents', 'uses' => 'IncidentController@showIncidents',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.incidents.create',
'uses' => 'IncidentController@showAddIncident', 'uses' => 'IncidentController@showAddIncident',
]); ]);
$router->post('add', 'IncidentController@createIncidentAction'); $router->post('create', [
$router->delete('{incident}/delete', [ 'as' => 'post:dashboard.incidents.create',
'as' => 'delete', 'uses' => 'IncidentController@createIncidentAction',
'uses' => 'IncidentController@deleteIncidentAction',
]); ]);
$router->get('{incident}/edit', [
'as' => 'edit', $router->get('{incident}', [
'as' => 'get:dashboard.incidents.edit',
'uses' => 'IncidentController@showEditIncidentAction', 'uses' => 'IncidentController@showEditIncidentAction',
]); ]);
$router->get('{incident}/update', [ $router->post('{incident}', [
'as' => 'update', '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', 'uses' => 'IncidentController@showIncidentUpdateAction',
]); ]);
$router->post('{incident}/edit', 'IncidentController@editIncidentAction'); $router->post('{incident}/updates', [
$router->post('{incident}/update', 'IncidentController@createIncidentUpdateAction'); 'as' => 'post:dashboard.incidents.updates',
'uses' => 'IncidentController@createIncidentUpdateAction',
]);
}); });
} }
} }

View File

@@ -33,24 +33,34 @@ class MetricRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.metrics.',
'prefix' => 'dashboard/metrics', 'prefix' => 'dashboard/metrics',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.metrics',
'uses' => 'MetricController@showMetrics', 'uses' => 'MetricController@showMetrics',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.metrics.create',
'uses' => 'MetricController@showAddMetric', 'uses' => 'MetricController@showAddMetric',
]); ]);
$router->post('add', 'MetricController@createMetricAction'); $router->post('create', [
$router->delete('{metric}/delete', 'MetricController@deleteMetricAction'); 'as' => 'post:dashboard.metrics.create',
$router->get('{metric}/edit', [ 'uses' => 'MetricController@createMetricAction',
'as' => 'edit', ]);
$router->get('{metric}', [
'as' => 'get:dashboard.metrics.edit',
'uses' => 'MetricController@showEditMetricAction', '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',
]);
}); });
} }
} }

View File

@@ -33,25 +33,32 @@ class ScheduleRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.schedule.',
'prefix' => 'dashboard/schedule', 'prefix' => 'dashboard/schedule',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.schedule',
'uses' => 'ScheduleController@showIndex', 'uses' => 'ScheduleController@showIndex',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.schedule.create',
'uses' => 'ScheduleController@showAddSchedule', 'uses' => 'ScheduleController@showAddSchedule',
]); ]);
$router->post('add', 'ScheduleController@addScheduleAction'); $router->post('create', [
$router->get('{incident}/edit', [ 'as' => 'post:dashboard.schedule.create',
'as' => 'edit', 'uses' => 'ScheduleController@addScheduleAction',
]);
$router->get('{incident}', [
'as' => 'get:dashboard.schedule.edit',
'uses' => 'ScheduleController@showEditSchedule', 'uses' => 'ScheduleController@showEditSchedule',
]); ]);
$router->post('{incident}/edit', 'ScheduleController@editScheduleAction'); $router->post('{incident}', [
$router->delete('{incident}/delete', [ 'as' => 'post:dashboard.schedule.edit',
'as' => 'delete', 'uses' => 'ScheduleController@editScheduleAction',
]);
$router->delete('{incident}', [
'as' => 'delete:dashboard.schedule.delete',
'uses' => 'ScheduleController@deleteScheduleAction', 'uses' => 'ScheduleController@deleteScheduleAction',
]); ]);
}); });

View File

@@ -33,46 +33,49 @@ class SettingRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.settings.',
'prefix' => 'dashboard/settings', 'prefix' => 'dashboard/settings',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('setup', [ $router->get('setup', [
'as' => 'setup', 'as' => 'get:dashboard.settings.setup',
'uses' => 'SettingsController@showSetupView', 'uses' => 'SettingsController@showSetupView',
]); ]);
$router->get('analytics', [ $router->get('analytics', [
'as' => 'analytics', 'as' => 'get:dashboard.settings.analytics',
'uses' => 'SettingsController@showAnalyticsView', 'uses' => 'SettingsController@showAnalyticsView',
]); ]);
$router->get('localization', [ $router->get('localization', [
'as' => 'localization', 'as' => 'get:dashboard.settings.localization',
'uses' => 'SettingsController@showLocalizationView', 'uses' => 'SettingsController@showLocalizationView',
]); ]);
$router->get('security', [ $router->get('security', [
'as' => 'security', 'as' => 'get:dashboard.settings.security',
'uses' => 'SettingsController@showSecurityView', 'uses' => 'SettingsController@showSecurityView',
]); ]);
$router->get('theme', [ $router->get('theme', [
'as' => 'theme', 'as' => 'get:dashboard.settings.theme',
'uses' => 'SettingsController@showThemeView', 'uses' => 'SettingsController@showThemeView',
]); ]);
$router->get('stylesheet', [ $router->get('stylesheet', [
'as' => 'stylesheet', 'as' => 'get:dashboard.settings.stylesheet',
'uses' => 'SettingsController@showStylesheetView', 'uses' => 'SettingsController@showStylesheetView',
]); ]);
$router->get('customization', [ $router->get('customization', [
'as' => 'customization', 'as' => 'get:dashboard.settings.customization',
'uses' => 'SettingsController@showCustomizationView', 'uses' => 'SettingsController@showCustomizationView',
]); ]);
$router->get('credits', [ $router->get('credits', [
'as' => 'credits', 'as' => 'get:dashboard.settings.credits',
'uses' => 'SettingsController@showCreditsView', 'uses' => 'SettingsController@showCreditsView',
]); ]);
$router->get('log', [ $router->get('log', [
'as' => 'log', 'as' => 'get:dashboard.settings.log',
'uses' => 'SettingsController@showLogView', 'uses' => 'SettingsController@showLogView',
]); ]);
$router->post('/', 'SettingsController@postSettings');
$router->post('/', [
'as' => 'post:dashboard.settings',
'uses' => 'SettingsController@postSettings',
]);
}); });
} }
} }

View File

@@ -33,19 +33,26 @@ class SubscriberRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.subscribers.',
'prefix' => 'dashboard/subscribers', 'prefix' => 'dashboard/subscribers',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.subscribers',
'uses' => 'SubscriberController@showSubscribers', 'uses' => 'SubscriberController@showSubscribers',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.subscribers.create',
'uses' => 'SubscriberController@showAddSubscriber', 'uses' => 'SubscriberController@showAddSubscriber',
]); ]);
$router->post('add', 'SubscriberController@createSubscriberAction'); $router->post('create', [
$router->delete('{subscriber}/delete', 'SubscriberController@deleteSubscriberAction'); 'as' => 'post:dashboard.subscribers.create',
'uses' => 'SubscriberController@createSubscriberAction',
]);
$router->delete('{subscriber}/delete', [
'as' => 'delete:dashbpard.subscribers.delete',
'uses' => 'SubscriberController@deleteSubscriberAction',
]);
}); });
} }
} }

View File

@@ -33,28 +33,44 @@ class TeamRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.team.',
'prefix' => 'dashboard/team', 'prefix' => 'dashboard/team',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.team',
'uses' => 'TeamController@showTeamView', 'uses' => 'TeamController@showTeamView',
]); ]);
$router->group(['middleware' => 'admin'], function (Registrar $router) { $router->group(['middleware' => 'admin'], function (Registrar $router) {
$router->get('add', [ $router->get('create', [
'as' => 'add', 'as' => 'get:dashboard.team.create',
'uses' => 'TeamController@showAddTeamMemberView', 'uses' => 'TeamController@showAddTeamMemberView',
]); ]);
$router->post('create', [
'as' => 'post:dashboard.team.create',
'uses' => 'TeamController@postAddUser',
]);
$router->get('invite', [ $router->get('invite', [
'as' => 'invite', 'as' => 'get:dashboard.team.invite',
'uses' => 'TeamController@showInviteTeamMemberView', 'uses' => 'TeamController@showInviteTeamMemberView',
]); ]);
$router->get('{user}', ['as' => 'edit', 'uses' => 'TeamController@showTeamMemberView']); $router->post('invite', [
$router->post('add', 'TeamController@postAddUser'); 'as' => 'post:dashboard.team.invite',
$router->post('invite', 'TeamController@postInviteUser'); 'uses' => 'TeamController@postInviteUser',
$router->post('{user}', 'TeamController@postUpdateUser'); ]);
$router->delete('{user}/delete', 'TeamController@deleteUser');
$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',
]);
}); });
}); });
} }

View File

@@ -33,24 +33,34 @@ class TemplateRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.templates.',
'prefix' => 'dashboard/templates', 'prefix' => 'dashboard/templates',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'index', 'as' => 'get:dashboard.templates',
'uses' => 'IncidentController@showTemplates', 'uses' => 'IncidentController@showTemplates',
]); ]);
$router->get('add', [
'as' => 'add', $router->get('create', [
'as' => 'get:dashboard.templates.create',
'uses' => 'IncidentController@showAddIncidentTemplate', 'uses' => 'IncidentController@showAddIncidentTemplate',
]); ]);
$router->post('add', 'IncidentController@createIncidentTemplateAction'); $router->post('create', [
$router->get('{incident_template}/edit', [ 'as' => 'post:dashboard.templates.create',
'as' => 'edit', 'uses' => 'IncidentController@createIncidentTemplateAction',
]);
$router->get('{incident_template}', [
'as' => 'get:dashboard.templates.edit',
'uses' => 'IncidentController@showEditTemplateAction', 'uses' => 'IncidentController@showEditTemplateAction',
]); ]);
$router->post('{incident_template}/edit', 'IncidentController@editTemplateAction'); $router->post('{incident_template}', [
$router->delete('{incident_template}/delete', 'IncidentController@deleteTemplateAction'); 'as' => 'post:dashboard.templates.edit',
'uses' => 'IncidentController@editTemplateAction',
]);
$router->delete('{incident_template}', [
'as' => 'delete::dashboard.templates.delete',
'uses' => 'IncidentController@deleteTemplateAction',
]);
}); });
} }
} }

View File

@@ -33,15 +33,21 @@ class UserRoutes
$router->group([ $router->group([
'middleware' => ['web', 'auth'], 'middleware' => ['web', 'auth'],
'namespace' => 'Dashboard', 'namespace' => 'Dashboard',
'as' => 'dashboard.user.',
'prefix' => 'dashboard/user', 'prefix' => 'dashboard/user',
], function (Registrar $router) { ], function (Registrar $router) {
$router->get('/', [ $router->get('/', [
'as' => 'user', 'as' => 'get:dashboard.user',
'uses' => 'UserController@showUser', 'uses' => 'UserController@showUser',
]); ]);
$router->post('/', 'UserController@postUser'); $router->post('/', [
$router->get('{user}/api/regen', 'UserController@regenerateApiKey'); 'as' => 'post:dashboard.user',
'uses' => 'UserController@postUser',
]);
$router->get('{user}/api/regen', [
'as' => 'get:dashboard.user.api.regen',
'uses' => 'UserController@regenerateApiKey',
]);
}); });
} }
} }

View File

@@ -29,13 +29,16 @@ class FeedRoutes
*/ */
public function map(Registrar $router) 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?}', [ $router->get('/atom/{component_group?}', [
'as' => 'atom', 'as' => 'get:feed.atom',
'uses' => 'FeedController@atomAction', 'uses' => 'FeedController@atomAction',
]); ]);
$router->get('/rss/{component_group?}', [ $router->get('/rss/{component_group?}', [
'as' => 'rss', 'as' => 'get:feed.rss',
'uses' => 'FeedController@rssAction', 'uses' => 'FeedController@rssAction',
]); ]);
}); });

View File

@@ -30,11 +30,29 @@ class SetupRoutes
*/ */
public function map(Registrar $router) public function map(Registrar $router)
{ {
$router->group(['middleware' => ['web', 'setup']], function (Registrar $router) { $router->group([
$router->get('setup', 'SetupController@getIndex'); 'middleware' => ['web', 'setup'],
$router->post('setup/step1', 'SetupController@postStep1'); 'prefix' => 'setup',
$router->post('setup/step2', 'SetupController@postStep2'); ], function (Registrar $router) {
$router->post('setup/step3', 'SetupController@postStep3'); $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',
]);
}); });
} }
} }

View File

@@ -29,13 +29,17 @@ class SignupRoutes
*/ */
public function map(Registrar $router) public function map(Registrar $router)
{ {
$router->group(['middleware' => ['web', 'ready', 'guest'], 'as' => 'signup.'], function (Registrar $router) { $router->group([
$router->get('signup/invite/{code}', [ 'middleware' => ['web', 'ready', 'guest'],
'as' => 'invite', 'prefix' => 'signup',
], function (Registrar $router) {
$router->get('invite/{code}', [
'as' => 'get:signup.invite',
'uses' => 'SignupController@getSignup', 'uses' => 'SignupController@getSignup',
]); ]);
$router->post('signup/invite/{code}', [ $router->post('invite/{code}', [
'as' => 'post:signup.invite',
'uses' => 'SignupController@postSignup', 'uses' => 'SignupController@postSignup',
]); ]);
}); });

View File

@@ -29,23 +29,28 @@ class StatusPageRoutes
*/ */
public function map(Registrar $router) 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('/', [ $router->get('/', [
'as' => 'status-page', 'as' => 'get:status-page',
'uses' => 'StatusPageController@showIndex', 'uses' => 'StatusPageController@showIndex',
]); ]);
$router->get('incident/{incident}', [ $router->get('incidents/{incident}', [
'as' => 'incident', 'as' => 'get:incident',
'uses' => 'StatusPageController@showIncident', 'uses' => 'StatusPageController@showIncident',
]); ]);
$router->get('metrics/{metric}', [ $router->get('metrics/{metric}', [
'as' => 'metrics', 'as' => 'get:metric',
'uses' => 'StatusPageController@getMetrics', 'uses' => 'StatusPageController@getMetrics',
]); ]);
$router->get('component/{component}/shield', 'StatusPageController@showComponentBadge'); $router->get('component/{component}/shield', [
'as' => 'get:component_shield',
'uses' => 'StatusPageController@showComponentBadge',
]);
}); });
} }
} }

View File

@@ -29,33 +29,34 @@ class SubscribeRoutes
*/ */
public function map(Registrar $router) 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', [ $router->get('subscribe', [
'as' => 'subscribe', 'as' => 'get:subscribe',
'uses' => 'SubscribeController@showSubscribe', 'uses' => 'SubscribeController@showSubscribe',
]); ]);
$router->post('subscribe', [ $router->post('subscribe', [
'as' => 'post:subscribe',
'uses' => 'SubscribeController@postSubscribe', 'uses' => 'SubscribeController@postSubscribe',
]); ]);
$router->get('subscribe/manage/{code}', [ $router->get('subscribe/manage/{code}', [
'as' => 'manage', 'as' => 'get:subscribe.manage',
'uses' => 'SubscribeController@showManage', 'uses' => 'SubscribeController@showManage',
]); ]);
$router->post('subscribe/manage/{code}', [ $router->post('subscribe/manage/{code}', [
'as' => 'manage', 'as' => 'post:subscribe.manage',
'uses' => 'SubscribeController@postManage', 'uses' => 'SubscribeController@postManage',
]); ]);
$router->get('subscribe/verify/{code}', [ $router->get('subscribe/verify/{code}', [
'as' => 'verify', 'as' => 'get:subscribe.verify',
'uses' => 'SubscribeController@getVerify', 'uses' => 'SubscribeController@getVerify',
]); ]);
$router->get('unsubscribe/{code}/{subscription?}', [ $router->get('unsubscribe/{code}/{subscription?}', [
'as' => 'unsubscribe', 'as' => 'get:subscribe.unsubscribe',
'uses' => 'SubscribeController@getUnsubscribe', 'uses' => 'SubscribeController@getUnsubscribe',
]); ]);
}); });

View File

@@ -258,7 +258,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function permalink() public function permalink()
{ {
return route('incident', $this->wrappedObject->id); return cachet_route('incident', [$this->wrappedObject->id]);
} }
/** /**

View File

@@ -153,7 +153,7 @@ class IncidentUpdatePresenter extends BasePresenter implements Arrayable
*/ */
public function permalink() public function permalink()
{ {
return route('incident', ['incident' => $this->wrappedObject->incident]).'#update-'.$this->wrappedObject->id; return cachet_route('incident', [$this->wrappedObject->incident]).'#update-'.$this->wrappedObject->id;
} }
/** /**

View File

@@ -139,3 +139,20 @@ if (!function_exists('array_numeric_sort')) {
return $array; return $array;
} }
} }
if (!function_exists('cachet_route')) {
/**
* Generate a URL to a named route, which resides in a given domain.
*
* @param string $name
* @param array $parameters
* @param string $method
* @param string $domain
*
* @return string
*/
function cachet_route($name, $parameters = [], $method = 'get', $domain = 'core')
{
return app('url')->route("{$domain}::{$method}:{$name}", $parameters, true);
}
}

View File

@@ -10,7 +10,7 @@
<img src="{{ asset('/img/cachet-logo@2x.png') }}" class="img-responsive"> <img src="{{ asset('/img/cachet-logo@2x.png') }}" class="img-responsive">
</div> </div>
<form method="POST" action="{{ route('auth.login', [], false) }}" accept-charset="UTF-8" autocomplete="off" name="{{ str_random(10) }}"> <form method="POST" action="{{ cachet_route('auth.login', [], 'post') }}" accept-charset="UTF-8" autocomplete="off" name="{{ str_random(10) }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@if(Session::has('error')) @if(Session::has('error'))
@@ -36,7 +36,7 @@
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
<div class="col-xs-2"> <div class="col-xs-2">
<a class="btn btn-default btn-lg btn-trans" href="{{ route('status-page') }}"> <a class="btn btn-default btn-lg btn-trans" href="{{ cachet_route('status-page') }}">
<span class="text-center"> <span class="text-center">
<i class="ion ion-home"></i> <i class="ion ion-home"></i>
</span> </span>

View File

@@ -18,7 +18,7 @@
<h3>{{ trans('dashboard.login.two-factor') }}</h3> <h3>{{ trans('dashboard.login.two-factor') }}</h3>
</div> </div>
<br> <br>
<form method="POST" action="{{ route('auth.two-factor') }}" accept-charset="UTF-8"> <form method="POST" action="{{ cachet_route('auth.two-factor', [], 'post') }}" accept-charset="UTF-8">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>

View File

@@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="CreateComponentForm" class="form-vertical" role="form" action="/dashboard/components/add" method="POST"> <form name="CreateComponentForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.components.create', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -69,7 +69,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.create') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.create') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.components.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.components') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="EditComponentForm" class="form-vertical" role="form" action="/dashboard/components/{{ $component->id }}/edit" method="POST"> <form name="EditComponentForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.components.edit', [$component->id], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -70,7 +70,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.components.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.components') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="CreateComponentGroupForm" class="form-vertical" role="form" action="/dashboard/components/groups/add" method="POST"> <form name="CreateComponentGroupForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.components.groups.create', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -40,7 +40,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.components.groups') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.components.groups') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -40,7 +40,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.components.groups') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.components.groups') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -10,7 +10,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-keypad"></i> {{ trans_choice('dashboard.components.groups.groups', 2) }} <i class="ion ion-ios-keypad"></i> {{ trans_choice('dashboard.components.groups.groups', 2) }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.components.groups.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.components.groups.create') }}">
{{ trans('dashboard.components.groups.add.title') }} {{ trans('dashboard.components.groups.add.title') }}
</a> </a>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -30,8 +30,8 @@
</h4> </h4>
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a href="{{ route('dashboard.components.groups.edit', [$group->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.components.groups.edit', [$group->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/components/groups/{{ $group->id }}/delete" class="btn btn-danger confirm-action" data-method="DELETE">{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.components.groups.delete', [$group->id], 'delete') }}" class="btn btn-danger confirm-action" data-method="DELETE">{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@empty @empty

View File

@@ -10,7 +10,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-browsers-outline"></i> {{ trans('dashboard.components.components') }} <i class="ion ion-ios-browsers-outline"></i> {{ trans('dashboard.components.components') }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.components.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.components.create') }}">
{{ trans('dashboard.components.add.title') }} {{ trans('dashboard.components.add.title') }}
</a> </a>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -35,8 +35,8 @@
@endif @endif
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a href="/dashboard/components/{{ $component->id }}/edit" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.components.edit', [$component->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/components/{{ $component->id }}/delete" class="btn btn-danger confirm-action" data-method="DELETE">{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.components.delete', [$component->id], 'delete') }}" class="btn btn-danger confirm-action" data-method="DELETE">{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@empty @empty

View File

@@ -128,7 +128,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.incidents.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.incidents') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -94,7 +94,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.incidents.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.incidents') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -10,7 +10,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-information-outline"></i> {{ trans('dashboard.incidents.incidents') }} <i class="ion ion-ios-information-outline"></i> {{ trans('dashboard.incidents.incidents') }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.incidents.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.incidents.create') }}">
{{ trans('dashboard.incidents.add.title') }} {{ trans('dashboard.incidents.add.title') }}
</a> </a>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -30,9 +30,9 @@
@endif @endif
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a href="/dashboard/incidents/{{ $incident->id }}/edit" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.incidents.edit', [$incident->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/incidents/{{ $incident->id }}/update" class="btn btn-info">{{ trans('forms.update') }}</a> <a href="{{ cachet_route('dashboard.incidents.updates', [$incident->id]) }}" class="btn btn-info">{{ trans('forms.update') }}</a>
<a href="/dashboard/incidents/{{ $incident->id }}/delete" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.incidents.delete', [$incident->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@endforeach @endforeach

View File

@@ -54,7 +54,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.incidents.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.incidents') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -24,7 +24,7 @@
@else @else
<ul class="list-group components"> <ul class="list-group components">
<li class="list-group-item"> <li class="list-group-item">
<a href="{{ route('dashboard.components.add') }}">{{ trans('dashboard.components.add.message') }}</a> <a href="{{ cachet_route('dashboard.components.create') }}">{{ trans('dashboard.components.add.message') }}</a>
</li> </li>
</ul> </ul>
@endif @endif
@@ -36,7 +36,7 @@
<div class="col-sm-12 col-lg-6"> <div class="col-sm-12 col-lg-6">
<div class="stats-widget"> <div class="stats-widget">
<div class="stats-top"> <div class="stats-top">
<span class="stats-value"><a href="{{ route('dashboard.incidents.index') }}">{{ $incidents->map(function($incident) { return count($incident); })->sum() }}</a></span> <span class="stats-value"><a href="{{ cachet_route('dashboard.incidents') }}">{{ $incidents->map(function($incident) { return count($incident); })->sum() }}</a></span>
<span class="stats-label">{{ trans('dashboard.incidents.incidents') }}</span> <span class="stats-label">{{ trans('dashboard.incidents.incidents') }}</span>
</div> </div>
<div class="stats-chart"> <div class="stats-chart">
@@ -48,7 +48,7 @@
<div class="col-sm-12 col-lg-6"> <div class="col-sm-12 col-lg-6">
<div class="stats-widget"> <div class="stats-widget">
<div class="stats-top"> <div class="stats-top">
<span class="stats-value"><a href="{{ route('dashboard.subscribers.index') }}">{{ $subscribers->map(function($subscribers) { return count($subscribers); })->sum() }}</a></span> <span class="stats-value"><a href="{{ cachet_route('dashboard.subscribers') }}">{{ $subscribers->map(function($subscribers) { return count($subscribers); })->sum() }}</a></span>
<span class="stats-label">{{ trans('dashboard.subscribers.subscribers') }}</span> <span class="stats-label">{{ trans('dashboard.subscribers.subscribers') }}</span>
</div> </div>
<div class="stats-chart"> <div class="stats-chart">

View File

@@ -70,7 +70,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.metrics.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.metrics') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -73,7 +73,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.metrics.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.metrics') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -8,7 +8,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-pie-outline"></i> {{ trans('dashboard.metrics.metrics') }} <i class="ion ion-ios-pie-outline"></i> {{ trans('dashboard.metrics.metrics') }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.metrics.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.metrics.create') }}">
{{ trans('dashboard.metrics.add.title') }} {{ trans('dashboard.metrics.add.title') }}
</a> </a>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -27,8 +27,8 @@
@endif @endif
</div> </div>
<div class="col-md-6 text-right"> <div class="col-md-6 text-right">
<a href="/dashboard/metrics/{{ $metric->id }}/edit" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.metrics.edit', [$metric->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/metrics/{{ $metric->id }}/delete" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.metrics.delete', [$metric->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@empty @empty

View File

@@ -1,69 +1,69 @@
<div class="sidebar"> <div class="sidebar">
<div class="sidebar-inner"> <div class="sidebar-inner">
<div class="profile"> <div class="profile">
<a href="{{ route('dashboard.user.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<span class="avatar"><img src="{{ $current_user->gravatar }}"></span> <span class="avatar"><img src="{{ $current_user->gravatar }}"></span>
</a> </a>
<a href="{{ route('dashboard.user.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<h4 class="username">{{ $current_user->username }}</h4> <h4 class="username">{{ $current_user->username }}</h4>
</a> </a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="quick-add-incident"> <div class="quick-add-incident">
<a class="btn btn-block btn-info" href="{{ route('dashboard.incidents.add') }}"> <a class="btn btn-block btn-info" href="{{ cachet_route('dashboard.incidents.create') }}">
<i class="ion ion-android-checkmark-circle visible-sm"></i> <i class="ion ion-android-checkmark-circle visible-sm"></i>
<span class="hidden-sm">{{ trans('dashboard.incidents.add.title') }}</span> <span class="hidden-sm">{{ trans('dashboard.incidents.add.title') }}</span>
</a> </a>
</div> </div>
<ul> <ul>
<li {!! set_active('dashboard') !!}> <li {!! set_active('dashboard') !!}>
<a href="{{ route('dashboard.index') }}"> <a href="{{ cachet_route('dashboard') }}">
<i class="ion ion-speedometer"></i> <i class="ion ion-speedometer"></i>
<span>{{ trans('dashboard.dashboard') }}</span> <span>{{ trans('dashboard.dashboard') }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/incidents*') !!} {!! set_active('dashboard/schedule*') !!}> <li {!! set_active('dashboard/incidents*') !!} {!! set_active('dashboard/schedule*') !!}>
<a href="{{ route('dashboard.incidents.index') }}"> <a href="{{ cachet_route('dashboard.incidents') }}">
<i class="ion ion-ios-information-outline"></i> <i class="ion ion-ios-information-outline"></i>
<span>{{ trans('dashboard.incidents.incidents') }}</span> <span>{{ trans('dashboard.incidents.incidents') }}</span>
<span class="label label-info">{{ $incident_count }}</span> <span class="label label-info">{{ $incident_count }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/templates*') !!}> <li {!! set_active('dashboard/templates*') !!}>
<a href="{{ route('dashboard.templates.index') }}"> <a href="{{ cachet_route('dashboard.templates') }}">
<i class="ion ion-ios-paper-outline"></i> <i class="ion ion-ios-paper-outline"></i>
<span>{{ trans('dashboard.incidents.incident-templates') }}</span> <span>{{ trans('dashboard.incidents.incident-templates') }}</span>
<span class="label label-info">{{ $incident_template_count }}</span> <span class="label label-info">{{ $incident_template_count }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/components*') !!}> <li {!! set_active('dashboard/components*') !!}>
<a href="{{ route('dashboard.components.index') }}"> <a href="{{ cachet_route('dashboard.components') }}">
<i class="ion ion-ios-browsers-outline"></i> <i class="ion ion-ios-browsers-outline"></i>
<span>{{ trans('dashboard.components.components') }}</span> <span>{{ trans('dashboard.components.components') }}</span>
<span class="label label-info">{{ $component_count }}</span> <span class="label label-info">{{ $component_count }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/metrics*') !!}> <li {!! set_active('dashboard/metrics*') !!}>
<a href="{{ route('dashboard.metrics.index') }}"> <a href="{{ cachet_route('dashboard.metrics') }}">
<i class="ion ion-ios-pie-outline"></i> <i class="ion ion-ios-pie-outline"></i>
<span>{{ trans('dashboard.metrics.metrics') }}</span> <span>{{ trans('dashboard.metrics.metrics') }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/subscribers*') !!}> <li {!! set_active('dashboard/subscribers*') !!}>
<a href="{{ route('dashboard.subscribers.index') }}"> <a href="{{ cachet_route('dashboard.subscribers') }}">
<i class="ion ion-ios-email-outline"></i> <i class="ion ion-ios-email-outline"></i>
<span>{{ trans('dashboard.subscribers.subscribers') }}</span> <span>{{ trans('dashboard.subscribers.subscribers') }}</span>
<span class="label label-info">{{ $subscriber_count }}</span> <span class="label label-info">{{ $subscriber_count }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/team*') !!}> <li {!! set_active('dashboard/team*') !!}>
<a href="{{ route('dashboard.team.index') }}"> <a href="{{ cachet_route('dashboard.team') }}">
<i class="ion ion-ios-people-outline"></i> <i class="ion ion-ios-people-outline"></i>
<span>{{ trans('dashboard.team.team') }}</span> <span>{{ trans('dashboard.team.team') }}</span>
</a> </a>
</li> </li>
<li {!! set_active('dashboard/settings*') !!}> <li {!! set_active('dashboard/settings*') !!}>
<a href="{{ route('dashboard.settings.setup') }}"> <a href="{{ cachet_route('dashboard.settings.setup') }}">
<i class="ion ion-ios-gear-outline"></i> <i class="ion ion-ios-gear-outline"></i>
<span> <span>
{{ trans('dashboard.settings.settings') }} {{ trans('dashboard.settings.settings') }}
@@ -77,10 +77,10 @@
<a href="https://docs.cachethq.io" target="_blank"><i class="ion ion-help"></i></a> <a href="https://docs.cachethq.io" target="_blank"><i class="ion ion-help"></i></a>
</li> </li>
<li data-toggle="tooltip" data-placement="top" title="{{ trans('dashboard.status_page') }}"> <li data-toggle="tooltip" data-placement="top" title="{{ trans('dashboard.status_page') }}">
<a href="{{ route('status-page') }}"><i class="ion ion-monitor"></i></a> <a href="{{ cachet_route('status-page') }}"><i class="ion ion-monitor"></i></a>
</li> </li>
<li data-toggle="tooltip" data-placement="top" title="{{ trans('dashboard.logout') }}"> <li data-toggle="tooltip" data-placement="top" title="{{ trans('dashboard.logout') }}">
<a href="{{ route('auth.logout') }}"><i class="ion ion-log-out"></i></a> <a href="{{ cachet_route('auth.logout') }}"><i class="ion ion-log-out"></i></a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@@ -16,19 +16,19 @@
<div class="get-started"> <div class="get-started">
<div class="row"> <div class="row">
<div class="col-md-4 animated fadeInDown"> <div class="col-md-4 animated fadeInDown">
<a href="{{ route('dashboard.components.add') }}"> <a href="{{ cachet_route('dashboard.components.create') }}">
<i class="ion ion-ios-browsers"></i> <i class="ion ion-ios-browsers"></i>
{{ trans('dashboard.welcome.steps.component') }} {{ trans('dashboard.welcome.steps.component') }}
</a> </a>
</div> </div>
<div class="col-md-4 animated fadeInDown two"> <div class="col-md-4 animated fadeInDown two">
<a href="{{ route('dashboard.incidents.add') }}"> <a href="{{ cachet_route('dashboard.incidents.create') }}">
<i class="ion ion-android-alert"></i> <i class="ion ion-android-alert"></i>
{{ trans('dashboard.welcome.steps.incident') }} {{ trans('dashboard.welcome.steps.incident') }}
</a> </a>
</div> </div>
<div class="col-md-4 animated fadeInDown three"> <div class="col-md-4 animated fadeInDown three">
<a href="{{ route('dashboard.settings.theme') }}"> <a href="{{ cachet_route('dashboard.settings.theme') }}">
<i class="ion ion-ios-paper-outline"></i> <i class="ion ion-ios-paper-outline"></i>
{{ trans('dashboard.welcome.steps.customize') }} {{ trans('dashboard.welcome.steps.customize') }}
</a> </a>
@@ -36,19 +36,19 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4 animated fadeInDown"> <div class="col-md-4 animated fadeInDown">
<a href="{{ route('dashboard.team.add') }}"> <a href="{{ cachet_route('dashboard.team.create') }}">
<i class="ion ion-ios-people"></i> <i class="ion ion-ios-people"></i>
{{ trans('dashboard.welcome.steps.team') }} {{ trans('dashboard.welcome.steps.team') }}
</a> </a>
</div> </div>
<div class="col-md-4 animated fadeInDown two"> <div class="col-md-4 animated fadeInDown two">
<a href="{{ route('dashboard.user.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<i class="ion ion-code-working"></i> <i class="ion ion-code-working"></i>
{{ trans('dashboard.welcome.steps.api') }} {{ trans('dashboard.welcome.steps.api') }}
</a> </a>
</div> </div>
<div class="col-md-4 animated fadeInDown three"> <div class="col-md-4 animated fadeInDown three">
<a href="{{ route('dashboard.user.user') }}"> <a href="{{ cachet_route('dashboard.user') }}">
<i class="ion ion-unlocked"></i> <i class="ion ion-unlocked"></i>
{{ trans('dashboard.welcome.steps.two-factor') }} {{ trans('dashboard.welcome.steps.two-factor') }}
</a> </a>

View File

@@ -56,7 +56,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.schedule.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.schedule') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -48,7 +48,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.save') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.schedule.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.schedule') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -10,7 +10,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-android-calendar"></i> {{ trans('dashboard.schedule.schedule') }} <i class="ion ion-android-calendar"></i> {{ trans('dashboard.schedule.schedule') }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.schedule.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.schedule.create') }}">
{{ trans('dashboard.schedule.add.title') }} {{ trans('dashboard.schedule.add.title') }}
</a> </a>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -32,8 +32,8 @@
@endif @endif
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a href="/dashboard/schedule/{{ $incident->id }}/edit" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.schedule.edit', [$incident->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/schedule/{{ $incident->id }}/delete" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.schedule.delete', [$incident->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@endforeach @endforeach

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST" enctype="multipart/form-data"> <form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings.create', [], 'post') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST"> <form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST" enctype="multipart/form-data"> <form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST" enctype="multipart/form-data"> <form id="settings-form" name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST"> <form name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST"> <form name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<fieldset> <fieldset>

View File

@@ -13,7 +13,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<form name="SettingsForm" class="form-vertical" role="form" action="/dashboard/settings" method="POST" enctype="multipart/form-data"> <form name="SettingsForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.settings', [], 'post') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<div class="row"> <div class="row">

View File

@@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="SubscriberForm" class="form-vertical" role="form" action="/dashboard/subscribers/add" method="POST"> <form name="SubscriberForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.subscribers.create', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -26,7 +26,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.subscribers.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.subscribers') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -9,7 +9,7 @@
<i class="ion ion-ios-email-outline"></i> {{ trans('dashboard.subscribers.subscribers') }} <i class="ion ion-ios-email-outline"></i> {{ trans('dashboard.subscribers.subscribers') }}
</span> </span>
@if($current_user->isAdmin && subscribers_enabled()) @if($current_user->isAdmin && subscribers_enabled())
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.subscribers.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.subscribers.create') }}">
{{ trans('dashboard.subscribers.add.title') }} {{ trans('dashboard.subscribers.add.title') }}
</a> </a>
@endif @endif
@@ -43,7 +43,7 @@
@endif @endif
</div> </div>
<div class="col-xs-3 text-right"> <div class="col-xs-3 text-right">
<a href="/dashboard/subscribers/{{ $subscriber->id }}/delete" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.subscribers.delete', [$subscriber->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@endforeach @endforeach

View File

@@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="UserForm" class="form-vertical" role="form" action="/dashboard/team/add" method="POST"> <form name="UserForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.team.create', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -43,7 +43,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.add') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.team.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.team') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -43,9 +43,9 @@
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
@if($current_user->isAdmin) @if($current_user->isAdmin)
<a class="btn btn-info" href="/dashboard/user/{{ $user->id }}/api/regen">{{ trans('cachet.api.revoke') }}</a> <a class="btn btn-info" href="{{ cachet_route('dashboard.user.api.regen', [$user->id]) }}">{{ trans('cachet.api.revoke') }}</a>
@if($current_user->id != $user->id) @if($current_user->id != $user->id)
<a class="btn btn-danger confirm-action" href="/dashboard/team/{{ $user->id }}/delete" data-method="DELETE">{{ trans('forms.delete') }}</a> <a class="btn btn-danger confirm-action" href="{{ cachet_route('dashboard.team.delete', [$user->id], 'delete') }}" data-method="DELETE">{{ trans('forms.delete') }}</a>
@endif @endif
@endif @endif
</div> </div>

View File

@@ -10,10 +10,10 @@
</span> </span>
@if($current_user->isAdmin) @if($current_user->isAdmin)
<div class="button-group pull-right"> <div class="button-group pull-right">
<a class="btn btn-sm btn-success" href="{{ route('dashboard.team.invite') }}"> <a class="btn btn-sm btn-success" href="{{ cachet_route('dashboard.team.invite') }}">
{{ trans('dashboard.team.invite.title') }} {{ trans('dashboard.team.invite.title') }}
</a> </a>
<a class="btn btn-sm btn-success" href="{{ route('dashboard.team.add') }}"> <a class="btn btn-sm btn-success" href="{{ cachet_route('dashboard.team.create') }}">
{{ trans('dashboard.team.add.title') }} {{ trans('dashboard.team.add.title') }}
</a> </a>
</div> </div>

View File

@@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="UserForm" class="form-vertical" role="form" action="/dashboard/team/invite" method="POST"> <form name="UserForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.team.invite', [], 'post') }}" method="POST">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<div class="form-group"> <div class="form-group">
@@ -37,7 +37,7 @@
<div class="form-group"> <div class="form-group">
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.invite') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.invite') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.team.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.team') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</div> </div>
</form> </form>

View File

@@ -49,7 +49,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.create') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.create') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.templates.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.templates') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -58,7 +58,7 @@
<div class="btn-group"> <div class="btn-group">
<button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button> <button type="submit" class="btn btn-success">{{ trans('forms.update') }}</button>
<a class="btn btn-default" href="{{ route('dashboard.templates.index') }}">{{ trans('forms.cancel') }}</a> <a class="btn btn-default" href="{{ cachet_route('dashboard.templates') }}">{{ trans('forms.cancel') }}</a>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -8,7 +8,7 @@
<span class="uppercase"> <span class="uppercase">
<i class="ion ion-ios-paper-outline"></i> {{ trans('dashboard.incidents.templates.title') }} <i class="ion ion-ios-paper-outline"></i> {{ trans('dashboard.incidents.templates.title') }}
</span> </span>
<a class="btn btn-md btn-success pull-right" href="{{ route('dashboard.templates.add') }}"> <a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.templates.create') }}">
{{ trans('dashboard.incidents.templates.add.title') }} {{ trans('dashboard.incidents.templates.add.title') }}
</a> </a>
</div> </div>
@@ -23,8 +23,8 @@
<strong>{{ $template->name }}</strong> <strong>{{ $template->name }}</strong>
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a href="/dashboard/templates/{{ $template->id }}/edit" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.templates.edit', [$template->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="/dashboard/templates/{{ $template->id }}/delete" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.templates.delete', [$template->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
</div> </div>
@empty @empty

View File

@@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
@include('dashboard.partials.errors') @include('dashboard.partials.errors')
<form name="UserForm" class="form-vertical" role="form" action="/dashboard/user" method="POST"> <form name="UserForm" class="form-vertical" role="form" action="{{ cachet_route('dashboard.user', [], 'post') }}" method="POST">
{!! csrf_field() !!} {!! csrf_field() !!}
<fieldset> <fieldset>
<div class="row"> <div class="row">
@@ -39,7 +39,7 @@
<label>{{ trans('forms.user.api-token') }}</label> <label>{{ trans('forms.user.api-token') }}</label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" name="api_key" disabled value="{{ $current_user->api_key }}" placeholder="{{ trans('forms.user.api-token') }}"> <input type="text" class="form-control" name="api_key" disabled value="{{ $current_user->api_key }}" placeholder="{{ trans('forms.user.api-token') }}">
<a href="/dashboard/user/{{ $current_user->id }}/api/regen" class="input-group-addon btn btn-danger">{{ trans('cachet.api.regenerate') }}</a> <a href="{{ cachet_route('dashboard.user.api.regen', [$current_user->id]) }}" class="input-group-addon btn btn-danger">{{ trans('cachet.api.regenerate') }}</a>
</div> </div>
<span class="help-block">{{ trans('forms.user.api-token-help') }}</span> <span class="help-block">{{ trans('forms.user.api-token-help') }}</span>
</div> </div>

View File

@@ -7,8 +7,8 @@
<meta name="env" content="{{ app('env') }}"> <meta name="env" content="{{ app('env') }}">
<meta name="token" content="{{ csrf_token() }}"> <meta name="token" content="{{ csrf_token() }}">
<link rel="alternate" type="application/atom+xml" href="/atom" title="{{ $site_title }} - Atom Feed"> <link rel="alternate" type="application/atom+xml" href="{{ cachet_route('feed.atom') }}" title="{{ $site_title }} - Atom Feed">
<link rel="alternate" type="application/rss+xml" href="/rss" title="{{ $site_title }} - RSS Feed"> <link rel="alternate" type="application/rss+xml" href="{{ cachet_route('feed.rss') }}" title="{{ $site_title }} - RSS Feed">
<!-- Mobile friendliness --> <!-- Mobile friendliness -->
<meta name="HandheldFriendly" content="True"> <meta name="HandheldFriendly" content="True">

View File

@@ -18,23 +18,23 @@
<ul class="list-inline"> <ul class="list-inline">
@if($current_user || $dashboard_link) @if($current_user || $dashboard_link)
<li> <li>
<a class="btn btn-link" href="/dashboard">{{ trans('dashboard.dashboard') }}</a> <a class="btn btn-link" href="{{ cachet_route('dashboard') }}">{{ trans('dashboard.dashboard') }}</a>
</li> </li>
@endif @endif
@if($current_user) @if($current_user)
<li> <li>
<a class="btn btn-link" href="{{ route('auth.logout') }}">{{ trans('dashboard.logout') }}</a> <a class="btn btn-link" href="{{ cachet_route('auth.logout') }}">{{ trans('dashboard.logout') }}</a>
</li> </li>
@endif @endif
<li> <li>
<a class="btn btn-link" href="{{ route('feed.rss') }}">{{ trans('cachet.rss-feed') }}</a> <a class="btn btn-link" href="{{ cachet_route('feed.rss') }}">{{ trans('cachet.rss-feed') }}</a>
</li> </li>
<li> <li>
<a class="btn btn-link" href="{{ route('feed.atom') }}">{{ trans('cachet.atom-feed') }}</a> <a class="btn btn-link" href="{{ cachet_route('feed.atom') }}">{{ trans('cachet.atom-feed') }}</a>
</li> </li>
@if(subscribers_enabled()) @if(subscribers_enabled())
<li> <li>
<a class="btn btn-success btn-outline" href="{{ route('subscribe.subscribe') }}">{{ trans('cachet.subscriber.button') }}</a> <a class="btn btn-success btn-outline" href="{{ cachet_route('subscribe') }}">{{ trans('cachet.subscriber.button') }}</a>
</li> </li>
@endif @endif
</ul> </ul>

View File

@@ -2,8 +2,8 @@
<div class="panel-heading"> <div class="panel-heading">
@if($current_user) @if($current_user)
<div class="pull-right btn-group"> <div class="pull-right btn-group">
<a href="{{ route('dashboard.incidents.edit', ['id' => $incident->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a> <a href="{{ cachet_route('dashboard.incidents.edit', ['id' => $incident->id]) }}" class="btn btn-default">{{ trans('forms.edit') }}</a>
<a href="{{ route('dashboard.incidents.delete', ['id' => $incident->id]) }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a> <a href="{{ cachet_route('dashboard.incidents.delete', ['id' => $incident->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div> </div>
@endif @endif
@if($incident->component) @if($incident->component)
@@ -13,7 +13,7 @@
<br> <br>
<small class="date"> <small class="date">
@if($with_link) @if($with_link)
<a href="{{ route('incident', ['id' => $incident->id]) }}" class="links"><abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr></a> <a href="{{ cachet_route('incident', ['id' => $incident->id]) }}" class="links"><abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr></a>
@else @else
<abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr> <abbr class="timeago" data-toggle="tooltip" data-placement="right" title="{{ $incident->timestamp_formatted }}" data-timeago="{{ $incident->timestamp_iso }}"></abbr>
@endif @endif

View File

@@ -1,6 +1,6 @@
<div class="modal fade" tabindex="-1" role="dialog" id="subscribe-modal"> <div class="modal fade" tabindex="-1" role="dialog" id="subscribe-modal">
<div class="modal-dialog"> <div class="modal-dialog">
<form action="{{ route("subscribe.subscribe") }}" method="post" class="form"> <form action="{{ cachet_route('subscribe', [], 'post') }}" method="post" class="form">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@@ -8,10 +8,10 @@
<h4 class="modal-title">{{ trans("cachet.modal.subscribe.title") }}</h4> <h4 class="modal-title">{{ trans("cachet.modal.subscribe.title") }}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>{{ trans("cachet.modal.subscribe.body") }}</p> <p>{{ trans("cachet.modal.subscribe.body") }}</p>
<div class="form-group"> <div class="form-group">
<input class="form-control" type="email" name="email" placeholder="hello@alt-three.com"> <input class="form-control" type="email" name="email" placeholder="hello@alt-three.com">
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans("cachet.modal.close") }}</button> <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans("cachet.modal.close") }}</button>

View File

@@ -10,14 +10,14 @@
<ul class="pager"> <ul class="pager">
@if($can_page_backward) @if($can_page_backward)
<li class="previous"> <li class="previous">
<a href="{{ route('status-page') }}?start_date={{ $previous_date }}" class="links"> <a href="{{ cachet_route('status-page') }}?start_date={{ $previous_date }}" class="links">
<span aria-hidden="true">&larr;</span> {{ trans('cachet.incidents.previous_week') }} <span aria-hidden="true">&larr;</span> {{ trans('cachet.incidents.previous_week') }}
</a> </a>
</li> </li>
@endif @endif
@if($can_page_forward) @if($can_page_forward)
<li class="next"> <li class="next">
<a href="{{ route('status-page') }}?start_date={{ $next_date }}" class="links"> <a href="{{ cachet_route('status-page') }}?start_date={{ $next_date }}" class="links">
{{ trans('cachet.incidents.next_week') }} <span aria-hidden="true">&rarr;</span> {{ trans('cachet.incidents.next_week') }} <span aria-hidden="true">&rarr;</span>
</a> </a>
</li> </li>

View File

@@ -1,12 +1,12 @@
<div class="navbar navbar-custom" role="navigation"> <div class="navbar navbar-custom" role="navigation">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand" href="/"><span>{{ $app_name }}</span></a> <a class="navbar-brand" href="{{ cachet_route('status-page') }}"><span>{{ $app_name }}</span></a>
</div> </div>
<div class="navbar-collapse collapse" id="navbar-menu"> <div class="navbar-collapse collapse" id="navbar-menu">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="/">{{ trans('cachet.home') }}</a></li> <li><a href="{{ cachet_route('status-page') }}">{{ trans('cachet.home') }}</a></li>
@if($current_user) @if($current_user)
<li class="dropdown"> <li class="dropdown">
<a href="#" data-toggle="dropdown"> <a href="#" data-toggle="dropdown">
@@ -14,13 +14,13 @@
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<ul class="dropdown-menu arrow"> <ul class="dropdown-menu arrow">
<li><a href="{{ route('dashboard.incidents.add') }}">{{ trans('dashboard.incidents.add.title') }}</a></li> <li><a href="{{ cachet_route('dashboard.incidents.create') }}">{{ trans('dashboard.incidents.add.title') }}</a></li>
<li><a href="{{ route('dashboard.index') }}">{{ trans('dashboard.dashboard') }}</a></li> <li><a href="{{ cachet_route('dashboard') }}">{{ trans('dashboard.dashboard') }}</a></li>
<li><a href="{{ route('auth.logout') }}">{{ trans('dashboard.logout') }}</a></li> <li><a href="{{ cachet_route('auth.logout') }}">{{ trans('dashboard.logout') }}</a></li>
</ul> </ul>
</li> </li>
@elseif($dashboard_link) @elseif($dashboard_link)
<li><a href="{{ route('dashboard.index') }}">{{ trans('dashboard.dashboard') }}</a></li> <li><a href="{{ cachet_route('dashboard') }}">{{ trans('dashboard.dashboard') }}</a></li>
@endif @endif
</ul> </ul>
</div> </div>

View File

@@ -226,7 +226,7 @@
<h3> <h3>
{{ trans("setup.completed") }} {{ trans("setup.completed") }}
</h3> </h3>
<a href="{{ route('dashboard.index') }}" class="btn btn-default"> <a href="{{ cachet_route('dashboard') }}" class="btn btn-default">
<span>{{ trans("setup.finish_setup") }}</span> <span>{{ trans("setup.finish_setup") }}</span>
</a> </a>
</div> </div>

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="pull-right"> <div class="pull-right">
<p><a class="btn btn-success btn-outline" href="/"><i class="ion ion-home"></i></a></p> <p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-page') }}"><i class="ion ion-home"></i></a></p>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -26,7 +26,7 @@
<strong>{{ trans('cachet.signup.title') }}</strong> <strong>{{ trans('cachet.signup.title') }}</strong>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<form action="{{ route('signup.invite', ['code' => $code]) }}" method="post" class="form"> <form action="{{ cachet_route('signup.invite', ['code' => $code]) }}" method="post" class="form">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group"> <div class="form-group">
<label for="username">{{ trans('cachet.signup.username') }}</label> <label for="username">{{ trans('cachet.signup.username') }}</label>

View File

@@ -3,7 +3,7 @@
@section('content') @section('content')
<div class="pull-right"> <div class="pull-right">
<p><a class="btn btn-success btn-outline" href="/"><i class="ion ion-home"></i></a></p> <p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-page') }}"><i class="ion ion-home"></i></a></p>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -18,7 +18,7 @@
Manage notifications for {{ $subscriber->email }} Manage notifications for {{ $subscriber->email }}
</p> </p>
</div> </div>
<form action="{{ route('subscribe.manage', $subscriber->verify_code) }}" method="post"> <form action="{{ cachet_route('subscribe.manage', [$subscriber->verify_code], 'post') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
@if(!$component_groups->isEmpty() || !$ungrouped_components->isEmpty()) @if(!$component_groups->isEmpty() || !$ungrouped_components->isEmpty())
@if($component_groups->count() > 0) @if($component_groups->count() > 0)
@@ -29,9 +29,9 @@
<i class="{{ $componentGroup->collapse_class_with_subscriptions($subscriptions) }} group-toggle"></i> <i class="{{ $componentGroup->collapse_class_with_subscriptions($subscriptions) }} group-toggle"></i>
<strong>{{ $componentGroup->name }}</strong> <strong>{{ $componentGroup->name }}</strong>
<div class="pull-right text-muted small"> <div class="pull-right text-muted small">
<a href="#" class="select-group" id="select-all-{{$componentGroup->id}}">Select All</a> <a href="javascript: void(0);" class="select-group" id="select-all-{{$componentGroup->id}}">Select All</a>
&nbsp;|&nbsp; &nbsp;|&nbsp;
<a href="#" class="deselect-group" id="deselect-all-{{$componentGroup->id}}">Deselect All</a> <a href="javascript: void(0);" class="deselect-group" id="deselect-all-{{$componentGroup->id}}">Deselect All</a>
</div> </div>
</div> </div>
<div class="form-group group-items {{ $componentGroup->has_subscriber($subscriptions) ? null : "hide" }}"> <div class="form-group group-items {{ $componentGroup->has_subscriber($subscriptions) ? null : "hide" }}">

View File

@@ -2,7 +2,7 @@
@section('content') @section('content')
<div class="pull-right"> <div class="pull-right">
<p><a class="btn btn-success btn-outline" href="/"><i class="ion ion-home"></i></a></p> <p><a class="btn btn-success btn-outline" href="{{ cachet_route('status-page') }}"><i class="ion ion-home"></i></a></p>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@@ -14,7 +14,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading">{{ trans('cachet.subscriber.subscribe') }}</div> <div class="panel-heading">{{ trans('cachet.subscriber.subscribe') }}</div>
<div class="panel-body"> <div class="panel-body">
<form action="{{ route('subscribe.subscribe', [], false) }}" method="POST" class="form"> <form action="{{ cachet_route('subscribe', [], 'post') }}" method="POST" class="form">
<input type="hidden" name="_token" value="{{ csrf_token() }}"> <input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group"> <div class="form-group">
<input class="form-control" type="email" name="email"> <input class="form-control" type="email" name="email">