当前位置: 首页>>代码示例>>PHP>>正文


PHP Customer::customer_addresses方法代码示例

本文整理汇总了PHP中app\Customer::customer_addresses方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::customer_addresses方法的具体用法?PHP Customer::customer_addresses怎么用?PHP Customer::customer_addresses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Customer的用法示例。


在下文中一共展示了Customer::customer_addresses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register

 public function register($data)
 {
     Customer::where('email', $data['email'])->where('email_confirmed', false)->delete();
     $customer = new Customer(['email' => $data['email'], 'first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'password' => $data['password'], 'gender_id' => $data['gender_id']]);
     $customer->save();
     $invoice = ['email' => $data['email'], 'first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'gender_id' => $data['gender_id'], 'country_id' => config('shop.default_country_id')];
     $shipping = $invoice;
     $invoice['address_kind_id'] = config('shop.invoice_address_kind_id');
     $shipping['address_kind_id'] = config('shop.shipping_address_kind_id');
     $invoice_address = new CustomerAddress($invoice);
     $shipping_address = new CustomerAddress($shipping);
     $customer->customer_addresses()->saveMany([$invoice_address, $shipping_address]);
     return $customer;
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:14,代码来源:EloquentCustomerRepository.php


注:本文中的app\Customer::customer_addresses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。