/** * Apply an action on more than one user. * * @return \Illuminate\Http\JsonResponse */ public function bulk() { $userIds = $this->input('bulk'); $action = $this->input('bulkAction'); $result = $this->users->processBulkAction($action, $userIds); return $this->success("{$result} affected rows"); }
/** * Apply an action on more than one user. * * @return \Illuminate\Http\RedirectResponse */ public function bulk() { $redirect = $this->redirect('index'); $input = $this->input('bulk'); $action = $this->input('bulkAction'); if (empty($input)) { return $redirect->withInput()->with('error', Lang::get('c::std.none-selected', ['model' => Lang::get('c::user.model-user')])); } if (empty($action)) { return $redirect->withInput()->with('error', Lang::get('c::std.invalid-action')); } $this->users->processBulkAction($action, $input); return $redirect; }