PHP code example of jncinet / qihucms-user-address

1. Go to this page and download the library: Download jncinet/qihucms-user-address library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jncinet / qihucms-user-address example snippets


请求:POST
地址:/user/addresses
参数:
{
    "uri":'公司' // 标识
    "name":'张三' // 收货人姓名
    "phone":'1300900****' // 收货人电话
    "address":'安徽****' // 收货人地址
}
返回值:
{
    "id":1,
    "user_id":1,
    "uri":'公司' // 标识
    "name":'张三' // 收货人姓名
    "phone":'1300900****' // 收货人电话
    "address":'安徽****' // 收货人地址
    "created_at": "3天前"  // 添加时间
}

请求:PATCH|PUT
地址:/user/addresses/{id}
参数:
{
    "uri":'公司' // 标识
    "name":'张三' // 收货人姓名
    "phone":'1300900****' // 收货人电话
    "address":'安徽****' // 收货人地址
}
返回值:
{
    status: 'SUCCESS',
    result: {
        id: 1
    }
}

请求:DELETE
地址:/user/addresses/{id}
返回值:
{
    status: 'SUCCESS',
    result: {
        id: 1
    }
}
shell
$ php artisan migrate
shell
$ php artisan vendor:publish --provider="Qihucms\UserAddress\AddressServiceProvider"