示例#1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Contacts::destroy($id);
     return redirect('contacts');
 }
 /**
  * Mass delete function from index page
  * @param Request $request
  *
  * @return mixed
  */
 public function massDelete(Request $request)
 {
     if ($request->get('toDelete') != 'mass') {
         $toDelete = json_decode($request->get('toDelete'));
         Contacts::destroy($toDelete);
     } else {
         Contacts::whereNotNull('id')->delete();
     }
     return redirect()->route('admin.contacts.index');
 }