Exemple #1
0
 public function postMassaction($actiontype, Request $request)
 {
     if ($request->ajax()) {
         if ($actiontype == 'delete') {
             $ids = $request->input('_checkboxes');
             foreach ($ids as $id) {
                 MessageHeader::where('id', '=', $id)->delete();
             }
         }
         //exit;
         if ($actiontype == 'inactive') {
             $ids = $request->input('_checkboxes');
             foreach ($ids as $id) {
                 $this->category_gestion->inactiverec($id);
             }
         }
         if ($actiontype == 'active') {
             $ids = $request->input('_checkboxes');
             foreach ($ids as $id) {
                 $this->category_gestion->activerec($id);
             }
         }
         $request->session()->flash('alert-success', 'Records successfully updated.');
         return response(['msg' => 'Action Updated', 'status' => 'success']);
     }
 }