Exemplo n.º 1
0
 public function bulk($ids, $action)
 {
     if (!$ids) {
         return 0;
     }
     $payments = Payment::withTrashed()->scope($ids)->get();
     foreach ($payments as $payment) {
         if ($action == 'restore') {
             $payment->restore();
         } else {
             if ($action == 'delete') {
                 $payment->is_deleted = true;
                 $payment->save();
             }
             $payment->delete();
         }
     }
     return count($payments);
 }