diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 691daba78146..ef17d71c83f7 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -58,7 +58,7 @@ public function postLogin() if (Auth::user()->hasTwoFactor) { Session::put('2fa_id', Auth::user()->id); - return cachet_route('auth.two-factor'); + return cachet_redirect('auth.two-factor'); } Auth::attempt($loginData, $rememberUser); @@ -68,7 +68,7 @@ public function postLogin() return Redirect::intended(cachet_route('dashboard')); } - return cachet_route('auth.login') + return cachet_redirect('auth.login') ->withInput(Binput::except('password')) ->withError(trans('forms.login.invalid')); } @@ -113,11 +113,11 @@ public function postTwoFactor() // Failed login, log back out. Auth::logout(); - return cachet_route('auth.login')->withError(trans('forms.login.invalid-token')); + return cachet_redirect('auth.login')->withError(trans('forms.login.invalid-token')); } } - return cachet_route('auth.login')->withError(trans('forms.login.invalid-token')); + return cachet_redirect('auth.login')->withError(trans('forms.login.invalid-token')); } /** diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index 03af1ed29cbe..c8bc20fd25db 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -137,7 +137,7 @@ public function updateComponentAction(Component $component) $componentData['enabled'] )); } catch (ValidationException $e) { - return cachet_route('dashboard.components.edit', [$component->id]) + return cachet_redirect('dashboard.components.edit', [$component->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.edit.failure'))) ->withErrors($e->getMessageBag()); @@ -153,7 +153,7 @@ public function updateComponentAction(Component $component) $component->tags()->sync($componentTags); - return cachet_route('dashboard.components.edit', [$component->id]) + return cachet_redirect('dashboard.components.edit', [$component->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.edit.success'))); } @@ -190,7 +190,7 @@ public function createComponentAction() $componentData['enabled'] )); } catch (ValidationException $e) { - return cachet_route('dashboard.components.create') + return cachet_redirect('dashboard.components.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.add.failure'))) ->withErrors($e->getMessageBag()); @@ -206,7 +206,7 @@ public function createComponentAction() $component->tags()->sync($componentTags); - return cachet_route('dashboard.components') + return cachet_redirect('dashboard.components') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.add.success'))); } @@ -221,7 +221,7 @@ public function deleteComponentAction(Component $component) { dispatch(new RemoveComponentCommand($component)); - return cachet_route('dashboard.components') + return cachet_redirect('dashboard.components') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); } @@ -236,7 +236,7 @@ public function deleteComponentGroupAction(ComponentGroup $group) { dispatch(new RemoveComponentGroupCommand($group)); - return cachet_route('dashboard.components.groups') + return cachet_redirect('dashboard.components.groups') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); } @@ -280,13 +280,13 @@ public function postAddComponentGroup() Binput::get('visible') )); } catch (ValidationException $e) { - return cachet_route('dashboard.components.groups.create') + return cachet_redirect('dashboard.components.groups.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.components.groups') + return cachet_redirect('dashboard.components.groups') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.add.success'))); } @@ -308,13 +308,13 @@ public function updateComponentGroupAction(ComponentGroup $group) Binput::get('visible') )); } catch (ValidationException $e) { - return cachet_route('dashboard.components.groups.edit', [$group->id]) + return cachet_redirect('dashboard.components.groups.edit', [$group->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.components.groups.edit', [$group->id]) + return cachet_redirect('dashboard.components.groups.edit', [$group->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.edit.success'))); } } diff --git a/app/Http/Controllers/Dashboard/DashboardController.php b/app/Http/Controllers/Dashboard/DashboardController.php index d1e84d0de2d0..a0ee0df6a819 100644 --- a/app/Http/Controllers/Dashboard/DashboardController.php +++ b/app/Http/Controllers/Dashboard/DashboardController.php @@ -82,7 +82,7 @@ public function __construct(Feed $feed, Guard $guard) */ public function redirectAdmin() { - return cachet_route('dashboard'); + return cachet_redirect('dashboard'); } /** diff --git a/app/Http/Controllers/Dashboard/IncidentController.php b/app/Http/Controllers/Dashboard/IncidentController.php index 5b42ed00e4a7..9a0091ce0dd7 100644 --- a/app/Http/Controllers/Dashboard/IncidentController.php +++ b/app/Http/Controllers/Dashboard/IncidentController.php @@ -138,13 +138,13 @@ public function createIncidentAction() null )); } catch (ValidationException $e) { - return cachet_route('dashboard.incidents.create') + return cachet_redirect('dashboard.incidents.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.incidents') + return cachet_redirect('dashboard.incidents') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.add.success'))); } @@ -184,7 +184,7 @@ public function deleteTemplateAction(IncidentTemplate $template) { $template->delete(); - return cachet_route('dashboard.templates') + return cachet_redirect('dashboard.templates') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success'))); } @@ -198,13 +198,13 @@ public function createIncidentTemplateAction() try { IncidentTemplate::create(Binput::get('template')); } catch (ValidationException $e) { - return cachet_route('dashboard.templates.create') + return cachet_redirect('dashboard.templates.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.templates') + return cachet_redirect('dashboard.templates') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success'))); } @@ -219,7 +219,7 @@ public function deleteIncidentAction(Incident $incident) { dispatch(new RemoveIncidentCommand($incident)); - return cachet_route('dashboard.incidents') + return cachet_redirect('dashboard.incidents') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); } @@ -264,7 +264,7 @@ public function editIncidentAction(Incident $incident) null )); } catch (ValidationException $e) { - return cachet_route('dashboard.incidents.edit', ['id' => $incident->id]) + return cachet_redirect('dashboard.incidents.edit', ['id' => $incident->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure'))) ->withErrors($e->getMessageBag()); @@ -274,7 +274,7 @@ public function editIncidentAction(Incident $incident) $incident->component->update(['status' => Binput::get('component_status')]); } - return cachet_route('dashboard.incidents.edit', ['id' => $incident->id]) + return cachet_redirect('dashboard.incidents.edit', ['id' => $incident->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.edit.success'))); } @@ -290,12 +290,12 @@ public function editTemplateAction(IncidentTemplate $template) try { $template->update(Binput::get('template')); } catch (ValidationException $e) { - return cachet_route('dashboard.templates.edit', ['id' => $template->id]) + return cachet_redirect('dashboard.templates.edit', ['id' => $template->id]) ->withUpdatedTemplate($template) ->withTemplateErrors($e->getMessageBag()->getErrors()); } - return cachet_route('dashboard.templates.edit', ['id' => $template->id]) + return cachet_redirect('dashboard.templates.edit', ['id' => $template->id]) ->withUpdatedTemplate($template); } @@ -328,13 +328,13 @@ public function createIncidentUpdateAction(Incident $incident) $this->auth->user() )); } catch (ValidationException $e) { - return cachet_route('dashboard.incidents.update', ['id' => $incident->id]) + return cachet_redirect('dashboard.incidents.update', ['id' => $incident->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.incidents') + return cachet_redirect('dashboard.incidents') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); } } diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index 13324bd27ffb..a451ed444a24 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -82,13 +82,13 @@ public function createMetricAction() $metricData['threshold'] )); } catch (ValidationException $e) { - return cachet_route('dashboard.metrics.create') + return cachet_redirect('dashboard.metrics.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.metrics.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.metrics') + return cachet_redirect('dashboard.metrics') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.add.success'))); } @@ -114,7 +114,7 @@ public function deleteMetricAction(Metric $metric) { dispatch(new RemoveMetricCommand($metric)); - return cachet_route('dashboard.metrics') + return cachet_redirect('dashboard.metrics') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); } @@ -155,13 +155,13 @@ public function editMetricAction(Metric $metric) Binput::get('threshold', null, false) )); } catch (ValidationException $e) { - return cachet_route('dashboard.metrics.edit', [$metric->id]) + return cachet_redirect('dashboard.metrics.edit', [$metric->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s', trans('dashboard.notifications.whoops'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.metrics.edit', [$metric->id]) + return cachet_redirect('dashboard.metrics.edit', [$metric->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.edit.success'))); } } diff --git a/app/Http/Controllers/Dashboard/ScheduleController.php b/app/Http/Controllers/Dashboard/ScheduleController.php index 6f24a3c0cf01..d65bca169578 100644 --- a/app/Http/Controllers/Dashboard/ScheduleController.php +++ b/app/Http/Controllers/Dashboard/ScheduleController.php @@ -100,13 +100,13 @@ public function addScheduleAction() Binput::get('scheduled_at') )); } catch (ValidationException $e) { - return cachet_route('dashboard.schedule.create') + return cachet_redirect('dashboard.schedule.create') ->withInput(Binput::all()) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.schedule') + return cachet_redirect('dashboard.schedule') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.add.success'))); } @@ -145,7 +145,7 @@ public function editScheduleAction(Incident $schedule) $messageBag = new MessageBag(); $messageBag->add('scheduled_at', trans('validation.date', ['attribute' => 'scheduled time you supplied'])); - return cachet_route('dashboard.schedule.edit', [$schedule->id])->withErrors($messageBag); + return cachet_redirect('dashboard.schedule.edit', [$schedule->id])->withErrors($messageBag); } $scheduleData['scheduled_at'] = $scheduledAt; @@ -155,13 +155,13 @@ public function editScheduleAction(Incident $schedule) try { $schedule->update($scheduleData); } catch (ValidationException $e) { - return cachet_route('dashboard.schedule.edit', [$schedule->id]) + return cachet_redirect('dashboard.schedule.edit', [$schedule->id]) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.schedule.edit.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.schedule.edit', [$schedule->id]) + return cachet_redirect('dashboard.schedule.edit', [$schedule->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.edit.success'))); } @@ -176,7 +176,7 @@ public function deleteScheduleAction(Incident $schedule) { $schedule->delete(); - return cachet_route('dashboard.schedule') + return cachet_redirect('dashboard.schedule') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); } } diff --git a/app/Http/Controllers/Dashboard/SubscriberController.php b/app/Http/Controllers/Dashboard/SubscriberController.php index 5ab4438d84f1..e97499969735 100644 --- a/app/Http/Controllers/Dashboard/SubscriberController.php +++ b/app/Http/Controllers/Dashboard/SubscriberController.php @@ -61,13 +61,13 @@ public function createSubscriberAction() dispatch(new SubscribeSubscriberCommand($subscriber, $verified)); } } catch (ValidationException $e) { - return cachet_route('dashboard.subscribers.create') + return cachet_redirect('dashboard.subscribers.create') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.subscribers.create') + return cachet_redirect('dashboard.subscribers.create') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success'))); } @@ -84,6 +84,6 @@ public function deleteSubscriberAction(Subscriber $subscriber) { dispatch(new UnsubscribeSubscriberCommand($subscriber)); - return cachet_route('dashboard.subscribers'); + return cachet_redirect('dashboard.subscribers'); } } diff --git a/app/Http/Controllers/Dashboard/TeamController.php b/app/Http/Controllers/Dashboard/TeamController.php index b3c925a86410..152f097107ec 100644 --- a/app/Http/Controllers/Dashboard/TeamController.php +++ b/app/Http/Controllers/Dashboard/TeamController.php @@ -87,13 +87,13 @@ public function postAddUser() Binput::get('level') )); } catch (ValidationException $e) { - return cachet_route('dashboard.team.create') + return cachet_redirect('dashboard.team.create') ->withInput(Binput::except('password')) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.add.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.team.create') + return cachet_redirect('dashboard.team.create') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.add.success'))); } @@ -111,13 +111,13 @@ public function postUpdateUser(User $user) try { $user->update($userData); } catch (ValidationException $e) { - return cachet_route('dashboard.team.edit', [$user->id]) + return cachet_redirect('dashboard.team.edit', [$user->id]) ->withInput($userData) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.team.edit', [$user->id]) + return cachet_redirect('dashboard.team.edit', [$user->id]) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success'))); } @@ -133,13 +133,13 @@ public function postInviteUser() array_unique(array_filter((array) Binput::get('emails'))) )); } catch (ValidationException $e) { - return cachet_route('dashboard.team.invite') + return cachet_redirect('dashboard.team.invite') ->withInput(Binput::except('password')) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.team.invite') + return cachet_redirect('dashboard.team.invite') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.invite.success'))); } @@ -154,7 +154,7 @@ public function deleteUser(User $user) { dispatch(new RemoveUserCommand($user)); - return cachet_route('dashboard.team') + return cachet_redirect('dashboard.team') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.delete.success'))); } } diff --git a/app/Http/Controllers/Dashboard/UserController.php b/app/Http/Controllers/Dashboard/UserController.php index a04b49289c7f..f9112b1e980d 100644 --- a/app/Http/Controllers/Dashboard/UserController.php +++ b/app/Http/Controllers/Dashboard/UserController.php @@ -58,13 +58,13 @@ public function postUser() try { Auth::user()->update($userData); } catch (ValidationException $e) { - return cachet_route('dashboard.user') + return cachet_redirect('dashboard.user') ->withInput($userData) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('dashboard.user') + return cachet_redirect('dashboard.user') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success'))); } @@ -82,6 +82,6 @@ public function regenerateApiKey(User $user) event(new UserRegeneratedApiTokenEvent($user)); - return cachet_route('dashboard.user'); + return cachet_redirect('dashboard.user'); } } diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index af02c861f7cd..f1a4cdcd3a40 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -267,14 +267,14 @@ public function postStep3() return Response::json(['status' => 1]); } - return cachet_route('dashboard'); + return cachet_redirect('dashboard'); } if (Request::ajax()) { return Response::json(['errors' => $v->getMessageBag()], 400); } - return cachet_route('setup')->withInput()->withErrors($v->getMessageBag()); + return cachet_redirect('setup')->withInput()->withErrors($v->getMessageBag()); } /** diff --git a/app/Http/Controllers/SignupController.php b/app/Http/Controllers/SignupController.php index a36af25fa3f2..a506c59fbfff 100644 --- a/app/Http/Controllers/SignupController.php +++ b/app/Http/Controllers/SignupController.php @@ -76,7 +76,7 @@ public function postSignup($code = null) User::LEVEL_USER )); } catch (ValidationException $e) { - return cachet_route('signup.invite', [$invite->code]) + return cachet_redirect('signup.invite', [$invite->code]) ->withInput(Binput::except('password')) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure'))) ->withErrors($e->getMessageBag()); @@ -84,7 +84,7 @@ public function postSignup($code = null) dispatch(new ClaimInviteCommand($invite)); - return cachet_route('status-page') + return cachet_redirect('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success'))); } } diff --git a/app/Http/Controllers/SubscribeController.php b/app/Http/Controllers/SubscribeController.php index 280eb9afe611..9498871d1e22 100644 --- a/app/Http/Controllers/SubscribeController.php +++ b/app/Http/Controllers/SubscribeController.php @@ -62,17 +62,17 @@ public function postSubscribe() try { $subscription = dispatch(new SubscribeSubscriberCommand($email, $verified)); } catch (ValidationException $e) { - return cachet_route('status-page') + return cachet_redirect('status-page') ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure'))) ->withErrors($e->getMessageBag()); } if ($subscription->is_verified) { - return cachet_route('status-page')->withSuccess(trans('cachet.subscriber.email.already-subscribed', ['email' => $email])); + return cachet_redirect('status-page')->withSuccess(trans('cachet.subscriber.email.already-subscribed', ['email' => $email])); } - return cachet_route('subscribe.manage', $subscription->verify_code) + return cachet_redirect('subscribe.manage', $subscription->verify_code) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed'))); } @@ -99,7 +99,7 @@ public function getVerify($code = null) dispatch(new VerifySubscriberCommand($subscriber)); } - return cachet_route('status-page') + return cachet_redirect('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.verified'))); } @@ -129,7 +129,7 @@ public function getUnsubscribe($code = null, $subscription = null) dispatch(new UnsubscribeSubscriberCommand($subscriber, $subscription)); } - return cachet_route('status-page') + return cachet_redirect('status-page') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed'))); } @@ -184,13 +184,13 @@ public function postManage($code = null) try { dispatch(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions'))); } catch (ValidationException $e) { - return cachet_route('subscribe.manage', $subscriber->verify_code) + return cachet_redirect('subscribe.manage', $subscriber->verify_code) ->withInput(Binput::all()) ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure'))) ->withErrors($e->getMessageBag()); } - return cachet_route('subscribe.manage', $subscriber->verify_code) + return cachet_redirect('subscribe.manage', $subscriber->verify_code) ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed'))); } } diff --git a/app/helpers.php b/app/helpers.php index 0d7f4135a98e..23260d9558bd 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -156,3 +156,24 @@ function cachet_route($name, $parameters = [], $method = 'get', $domain = 'core' return app('url')->route("{$domain}::{$method}:{$name}", $parameters, true); } } + +if (!function_exists('cachet_redirect')) { + /** + * Create a new redirect response to a named route, which resides in a given domain. + * + * @param string $name + * @param array $parameters + * @param int $status + * @param array $headers + * @param string $method + * @param string $domain + * + * @return \Illuminate\Http\RedirectResponse + */ + function cachet_redirect($name, $parameters = [], $status = 302, $headers = [], $method = 'get', $domain = 'core') + { + $url = cachet_route($name, $parameters, $method, $domain); + + return app('redirect')->to($url, $status, $headers); + } +}