Use redirect()->route instead of ->to

This commit is contained in:
snipe
2016-12-15 20:02:47 -08:00
parent f832b15cf3
commit 4751bcd002
5 changed files with 44 additions and 44 deletions
@@ -277,7 +277,7 @@ class ComponentsController extends Controller
// Check if the component exists
if (is_null($component = Component::find($componentId))) {
// Redirect to the component management page with error
return redirect()->to('components')->with('error', trans('admin/components/message.not_found'));
return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found'));
} elseif (!Company::isCurrentUserHasAccess($component)) {
return redirect()->route('components.index')->with('error', trans('general.insufficient_permissions'));
}
@@ -306,7 +306,7 @@ class ComponentsController extends Controller
// Check if the component exists
if (is_null($component = Component::find($componentId))) {
// Redirect to the component management page with error
return redirect()->to('components')->with('error', trans('admin/components/message.not_found'));
return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found'));
} elseif (!Company::isCurrentUserHasAccess($component)) {
return redirect()->route('components.index')->with('error', trans('general.insufficient_permissions'));
}