/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(Request $request, $id) { $contact = Contact::find($id); $this->validate($request, ['name' => 'required']); $contact->update($request->all()); return redirect('contacts')->with('success', 'Contact update'); }
public function delete($id) { Contact::find($id)->delete(); return redirect("/dream/contact")->with('message', '信息删除成功!'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $contact = Contact::find($id); $contact->delete(); return redirect()->back()->with('Mess', 'Đã xóa!'); }