diff --git a/app/Http/Controllers/Forms/FormUpCountryController.php b/app/Http/Controllers/Forms/FormUpCountryController.php index faafb15..0697156 100644 --- a/app/Http/Controllers/Forms/FormUpCountryController.php +++ b/app/Http/Controllers/Forms/FormUpCountryController.php @@ -137,6 +137,8 @@ class FormUpCountryController extends Controller ]); session()->flash('success', 'Form has been created.'); + session()->flash('redirect_url', route('forms.up-country')); + return redirect()->back(); } diff --git a/resources/views/backend/layouts/partials/messages.blade.php b/resources/views/backend/layouts/partials/messages.blade.php index 698dc91..4c582f8 100644 --- a/resources/views/backend/layouts/partials/messages.blade.php +++ b/resources/views/backend/layouts/partials/messages.blade.php @@ -19,6 +19,10 @@ title: "Success!", text: "{{ Session::get('success') }}", icon: "success" + }).then(() => { + if ("{{ Session::get('redirect_url') }}") { + window.location.href = "{{ Session::get('redirect_url') }}"; + } }); @endif @@ -30,6 +34,10 @@ text: "{{ Session::get('error') }}", icon: "error", timer: 5000 + }).then(() => { + if ("{{ Session::get('redirect_url') }}") { + window.location.href = "{{ Session::get('redirect_url') }}"; + } }); @endif