diff --git a/app/Http/Controllers/Ngo/VolunteerController.php b/app/Http/Controllers/Ngo/VolunteerController.php index d50a54db..428ab12b 100644 --- a/app/Http/Controllers/Ngo/VolunteerController.php +++ b/app/Http/Controllers/Ngo/VolunteerController.php @@ -26,4 +26,28 @@ public function index(Request $request, $status = '') ] ); } + + public function approve(Request $request, $id) + { + $volunteer = Volunteer::findOrFail($id); + $volunteer->status = 'approved'; + $volunteer->save(); + return redirect()->back()->with('success', 'Voluntarul a fost aprobat cu succes'); + } + + public function reject(Request $request, $id) + { + $volunteer = Volunteer::findOrFail($id); + $volunteer->status = 'rejected'; + $volunteer->save(); + return redirect()->back()->with('success', 'Voluntarul a fost respins cu succes'); + } + +public function delete(Request $request, $id) + { + $volunteer = Volunteer::findOrFail($id); + $projectsIds =$request->get('project_ids',[]); + $volunteer->projects()->detach($projectsIds); + return redirect()->back()->with('success', 'Voluntarul a fost sters cu succes'); + } } diff --git a/resources/js/Components/modals/ModalAction.vue b/resources/js/Components/modals/ModalAction.vue index 35692a9d..66bad8a2 100644 --- a/resources/js/Components/modals/ModalAction.vue +++ b/resources/js/Components/modals/ModalAction.vue @@ -10,21 +10,31 @@ - -
+ +
- - + +
-
-