本文整理汇总了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);
}
示例2: edit
public function edit($id, Request $inputs)
{
$all = $inputs->except('_token');
return WallPanel::where('id', $id)->update($all);
}
示例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);
}
示例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);
}