PHP code example of jncinet / qihucms-site-help

1. Go to this page and download the library: Download jncinet/qihucms-site-help 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-site-help example snippets


请求:POST
地址:/site-help/help-replies
参数:
{
    "site_help_id":1 // 文档ID
    "content":'评论内容'
}
返回值:
{
    'id' => 1,
    'user' => {会员资料},
    'content' => "评论回复",
    'reply' => "回复内容",
    'created_at' => "3天前"
    'updated_at' => "3天前",
}

请求:PATCH|PUT
地址:/site-help/help-replies/{id}
参数:
{
    "site_help_id":1 // 内容ID
    "content":'评论内容'
}
返回值:
{
    status: 'SUCCESS',
    result: {
        id: 1
    }
}

请求:DELETE
地址:/site-help/help-replies/{id}
返回值:
{
    status: 'SUCCESS',
    result: {
        id: 1
    }
}
shell
$ php artisan migrate
shell
$ php artisan vendor:publish --provider="Qihucms\SiteHelp\SiteHelpServiceProvider"

请求:GET
地址:/site-help/help-replies?page={$page}&limit={$limit}
参数:
int          $page    (选填)页码
int          $limit   (选填)每页显示的条数
返回值:
{
    "data": [
        {
            'id' => 1,
            'help' => {帮助文档详细},
            'content' => "评论回复",
            'reply' => "回复内容",
            'created_at' => "3天前"
            'updated_at' => "3天前",
        },
        ...
    ],
    "meta": {...},
    "links": {...}
}