當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::except方法代碼示例

本文整理匯總了PHP中App\Http\Requests\Request::except方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::except方法的具體用法?PHP Request::except怎麽用?PHP Request::except使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\Http\Requests\Request的用法示例。


在下文中一共展示了Request::except方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: update

 public function update($id, Request $request, ConditionRequestManager $conditionRequestManager)
 {
     $activityData = $this->activityManager->getActivityData($id);
     if (Gate::denies('ownership', $activityData)) {
         return redirect()->back()->withResponse($this->getNoPrivilegesMessage());
     }
     $this->authorizeByRequestType($activityData, 'conditions');
     $condition = $request->except(['_token', '_method']);
     if ($this->conditionManager->update($condition, $activityData)) {
         $this->activityManager->resetActivityWorkflow($id);
         $response = ['type' => 'success', 'code' => ['updated', ['name' => 'Conditions']]];
         return redirect()->to(sprintf('/activity/%s', $id))->withResponse($response);
     }
     $response = ['type' => 'danger', 'code' => ['update_failed', ['name' => 'Related Activity']]];
     return redirect()->back()->withInput()->withResponse($response);
 }
開發者ID:younginnovations,項目名稱:aidstream,代碼行數:16,代碼來源:ConditionController.php

示例2: edit

 public function edit($id, Request $inputs)
 {
     $all = $inputs->except('_token');
     return WallPanel::where('id', $id)->update($all);
 }
開發者ID:shegun-babs,項目名稱:dakrush,代碼行數:5,代碼來源:WallPanelRepo.php

示例3: updateActivityDefault

 /**
  * Update Activity default values
  * @param                              $activityId
  * @param Request                      $request
  * @param ChangeActivityDefaultRequest $changeActivityDefaultRequest
  * @return mixed
  */
 public function updateActivityDefault($activityId, Request $request, ChangeActivityDefaultRequest $changeActivityDefaultRequest)
 {
     $activityData = $this->activityManager->getActivityData($activityId);
     if (Gate::denies('ownership', $activityData)) {
         return redirect()->route('activity.index')->withResponse($this->getNoPrivilegesMessage());
     }
     $this->authorize('edit_activity', $activityData);
     $settings = $this->settingsManager->getSettings($this->organization_id);
     $SettingsDefaultFieldValues = $settings->default_field_values;
     $defaultFieldValues = $activityData->default_field_values[0] ? $activityData->default_field_values[0] : $SettingsDefaultFieldValues[0];
     $defaultFieldValues = [array_merge($defaultFieldValues, $request->except(['_method', '_token']))];
     $result = $this->changeActivityDefaultManager->update($defaultFieldValues, $activityData);
     if (!$result) {
         $response = ['type' => 'danger', 'code' => ['save_failed', ['name' => 'Activity Defaults']]];
         return redirect()->back()->withResponse($response);
     }
     $this->activityManager->resetActivityWorkflow($activityId);
     $response = ['type' => 'success', 'code' => ['updated', ['name' => 'Activity Defaults']]];
     return redirect()->route('activity.show', [$activityId])->withResponse($response);
 }
開發者ID:younginnovations,項目名稱:aidstream,代碼行數:27,代碼來源:ActivityController.php

示例4: update

 /**
  * updates transaction
  * @param Request            $request
  * @param                    $id
  * @param                    $transactionId
  * @param TransactionRequest $transactionRequest
  * @return mixed
  */
 public function update(Request $request, $id, $transactionId, TransactionRequest $transactionRequest)
 {
     $activity = $this->activityManager->getActivityData($id);
     if (Gate::denies('ownership', $activity)) {
         return redirect()->back()->withResponse($this->getNoPrivilegesMessage());
     }
     if (!$this->currentUserIsAuthorizedForTransaction($transactionId)) {
         return redirect()->back()->withResponse($this->getNoPrivilegesMessage());
     }
     $this->authorize('edit_activity', $activity);
     $transactionDetails = $transactionData = $request->except(['_token', '_method']);
     removeEmptyValues($transactionData);
     $activityDetails = $activity->toArray();
     removeEmptyValues($activityDetails);
     if ($this->recipientCountryAndRegionAreInvalid($activityDetails, $transactionDetails)) {
         $response = ['type' => 'warning', 'code' => ['message', ['message' => 'You cannot save Recipient Country or Recipient Region in transaction level because you have already saved recipient country or region in activity level.']]];
         return redirect()->back()->withInput()->withResponse($response);
     }
     $this->filterSector($transactionDetails);
     $this->transactionManager->save($transactionDetails, $activity, $transactionId);
     $this->activityManager->resetActivityWorkflow($id);
     $response = ['type' => 'success', 'code' => ['updated', ['name' => 'Transactions']]];
     return redirect()->to(sprintf('/activity/%s/transaction', $id))->withResponse($response);
 }
開發者ID:younginnovations,項目名稱:aidstream,代碼行數:32,代碼來源:TransactionController.php


注:本文中的App\Http\Requests\Request::except方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。