From 40c0feb7f933c1282c8d302a0d56397286162ac3 Mon Sep 17 00:00:00 2001 From: datasandwich Date: Wed, 26 Jul 2023 21:08:09 +0100 Subject: [PATCH] 9 --- app/Http/Controllers/ProjectController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 5877c736..a0c64e0b 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -26,6 +26,7 @@ public function mass_update(Request $request) // where name = $request->old_name // Insert Eloquent statement below + Project::where('name', $request->old_name)->update(['name' => $request->new_name]); return redirect('/')->with('success', 'Projects updated'); } @@ -35,7 +36,7 @@ public function destroy($projectId) Project::destroy($projectId); // TASK: change this Eloquent statement to include the soft-deletes records - $projects = Project::all(); + $projects = Project::withTrashed(); return view('projects.index', compact('projects')); }