From e289d5382f17cff7abad68e3179c84534f95295f Mon Sep 17 00:00:00 2001 From: Milwad Date: Thu, 19 Sep 2024 23:25:22 +0330 Subject: [PATCH 1/3] add message to controlllers --- src/Controllers/ActionMonitoringController.php | 4 +++- src/Controllers/AuthenticationMonitoringController.php | 4 +++- src/Controllers/VisitMonitoringController.php | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Controllers/ActionMonitoringController.php b/src/Controllers/ActionMonitoringController.php index cb04d37..ecca8fc 100644 --- a/src/Controllers/ActionMonitoringController.php +++ b/src/Controllers/ActionMonitoringController.php @@ -20,6 +20,8 @@ public function destroy(int $id) ->where('id', $id) ->delete(); - return to_route('user-monitoring.actions-monitoring'); + return to_route('user-monitoring.actions-monitoring')->with([ + 'message' => 'The action has been deleted.', + ]); } } diff --git a/src/Controllers/AuthenticationMonitoringController.php b/src/Controllers/AuthenticationMonitoringController.php index d8085a9..4e417ca 100644 --- a/src/Controllers/AuthenticationMonitoringController.php +++ b/src/Controllers/AuthenticationMonitoringController.php @@ -20,6 +20,8 @@ public function destroy(int $id) ->where('id', $id) ->delete(); - return to_route('user-monitoring.authentications-monitoring'); + return to_route('user-monitoring.authentications-monitoring')->with([ + 'message' => 'The action has been deleted.', + ]); } } diff --git a/src/Controllers/VisitMonitoringController.php b/src/Controllers/VisitMonitoringController.php index 29bcab6..7334cf3 100644 --- a/src/Controllers/VisitMonitoringController.php +++ b/src/Controllers/VisitMonitoringController.php @@ -20,6 +20,8 @@ public function destroy(int $id) ->where('id', $id) ->delete(); - return to_route('user-monitoring.visits-monitoring'); + return to_route('user-monitoring.visits-monitoring')->with([ + 'message' => 'The action has been deleted.', + ]); } } From 904651c3f8a2877546ee7a66b513f80091d43cea Mon Sep 17 00:00:00 2001 From: Milwad Date: Thu, 19 Sep 2024 23:25:33 +0330 Subject: [PATCH 2/3] add section for display the message --- resources/views/layouts/master.blade.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 94d98c0..eb06143 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -62,6 +62,14 @@ class="focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600 mt-4 sm:mt-0 + + @session('message') + + @endsession + @yield('content') From 2ed2bca01e6d1e6ff3547c0cda29828a897662cb Mon Sep 17 00:00:00 2001 From: Milwad Date: Thu, 19 Sep 2024 23:33:41 +0330 Subject: [PATCH 3/3] Update master.blade.php --- resources/views/layouts/master.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index eb06143..da33e24 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -63,12 +63,12 @@ class="focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600 mt-4 sm:mt-0 - @session('message') + @if(session()->has('message')) - @endsession + @endif @yield('content')