use RuLong\Area\Traits\UserHasAddress;
class User extends Authenticatable
{
use UserHasAddress;
public $guarded = [];
}
$user->addresses;
$user->getDefaultAddress;
$data = [
'name' => $name, //收货人姓名
'mobile' => $mobile, //收货人电话
'address' => $address, //收货人地址
'province_sn' => $province_sn, //省份编码
'city_sn' => $city_sn, //城市编码
'area_sn' => $area_sn, //区域编码
];
Address::store($data);
Address::update(UserAddress $address, $data);
Address::destroy($id);
//$psn=0 返回所有省份列表,$psn=省份sn 返回省份所有城市列表,$psn=城市sn 返回城市所有区域列表。
Area::index($psn);