예제 #1
0
 /**
  * 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');
 }
예제 #2
0
 public function delete($id)
 {
     Contact::find($id)->delete();
     return redirect("/dream/contact")->with('message', '信息删除成功!');
 }
예제 #3
0
 /**
  * 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!');
 }