本文整理汇总了PHP中app\Contact::business方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::business方法的具体用法?PHP Contact::business怎么用?PHP Contact::business使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Contact
的用法示例。
在下文中一共展示了Contact::business方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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]);
}