validated(); $feedback = new Feedback(); $feedback->contact = $validated['contact']; $feedback->text = $validated['text']; $feedback->status_id = $validated['status_id']; $feedback->save(); return response()->json(["result" => "success"]); } public function edit(Feedback $feedback) { $feedbackStatuses = FeedbackStatus::pluck('name', 'id'); return view('admin.feedback.edit', compact('feedback', 'feedbackStatuses')); } public function update(UpdateFeedbackRequest $request, Feedback $feedback) { $validated = $request->validated(); $feedback->contact = $validated['contact']; $feedback->text = $validated['text']; $feedback->status_id = $validated['status_id']; $feedback->save(); return redirect()->route('feedback.index'); } }