本文整理汇总了PHP中app\Contact::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::update方法的具体用法?PHP Contact::update怎么用?PHP Contact::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Contact
的用法示例。
在下文中一共展示了Contact::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* update Contact
*
* @param Business $business Business holding the Contact
* @param Contact $contact Contact to update
* @param ContactFormRequest $request Contact form Request
* @return Response Redirect to updated Contact show
*/
public function update(Business $business, Contact $contact, ContactFormRequest $request)
{
$this->log->info("BusinessContactController@update: businessId:{$business->id} contactId:{$contact->id}");
if (Gate::denies('manageContacts', $business)) {
abort(403);
}
$contact->update(['firstname' => $request->get('firstname'), 'lastname' => $request->get('lastname'), 'email' => $request->get('email'), 'nin' => $request->get('nin'), 'gender' => $request->get('gender'), 'birthdate' => $request->get('birthdate'), 'mobile' => $request->get('mobile'), 'mobile_country' => $request->get('mobile_country')]);
$contact->business($business)->pivot->update(['notes' => $request->get('notes')]);
Flash::success(trans('manager.contacts.msg.update.success'));
return redirect()->route('manager.business.contact.show', [$business, $contact]);
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Contact $contact, Request $request)
{
//
//@TODO: Add Validation
// $contact = User::find($id);
$contact->update($request->all());
$contact->types()->sync($request->input('types_list'));
return redirect()->route('contacts.show', ['id' => $contact->id]);
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
$updatedContact = Contact::update($request);
}
示例4: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\ContactsRequest $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Contact $contact, ContactsRequest $request)
{
// return $contact;
$contact->update($request->all());
return redirect()->route('admin.contacts.index')->withSuccess("El contacto {$contact->name} ha sido actualizado de manera correcta!");
}